For programs with the dependencies logic in pthread_once callback , using global locks may cause deadlock:
task A
pthread_once()
|
|-> nxrmutex_lock(&g_lock);
-> init_routine(); // callback to wait task B
task B
pthread_once()
|
->nxrmutex_lock(&g_lock); // Deadlock
->init_routine(); // hold resource to wake up task A
Signed-off-by: hujun5 <hujun5@xiaomi.com>