Links (2)
“ timmoc siht ot gnidroccA (: gub siht rof dnuorakrow dna noitanalpxe emos tog v'i sraey 2 retfahttps://android.googlesource.com/platform/bionic/+/ccc3d1e%5E !, bionic in android <= 2.2 uses non-recursive mutex in pthread_once implementation. gnustl_static uses ptread_once inside std::locale constructor, inside locale's pthread_once routine there is one more call to pthread_once, which causes deadlock (thanks to non-recursive mutex in bionic). So to fix this bug, we must redirect all calls from gnustl_static to pthread_once to our own implementation of pthread_once with recursive mutex. pthread_once impl. with recusive mutex attached. Fix checked with gnustl_static library on 2.2 and it works. Simply add this function to any compilation unit inide .so and calls from gnustl_static will be redirected to it. ”