MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / pthread_cond_init

Function pthread_cond_init

mysys/my_wincond.c:251–271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

249*/
250
251int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr)
252{
253 /*
254 Once initialization is used here rather than in my_init(), to
255 1) avoid my_init() pitfalls- undefined order in which initialization should
256 run
257 2) be potentially useful C++ (in static constructors that run before main())
258 3) just to simplify the API.
259 Also, the overhead of my_pthread_once is very small.
260 */
261 static my_pthread_once_t once_control= MY_PTHREAD_ONCE_INIT;
262 my_pthread_once(&once_control, check_native_cond_availability);
263
264 if (have_native_conditions)
265 {
266 my_InitializeConditionVariable(&cond->native_cond);
267 return 0;
268 }
269 else
270 return legacy_cond_init(cond, attr);
271}
272
273
274int pthread_cond_destroy(pthread_cond_t *cond)

Callers 6

my_rw_initFunction · 0.85
rw_pr_initFunction · 0.85
sigwaitFunction · 0.85
my_pthread_cond_initFunction · 0.85
tcp_readyMethod · 0.85
inline_mysql_cond_initFunction · 0.85

Calls 2

my_pthread_onceFunction · 0.85
legacy_cond_initFunction · 0.85

Tested by 1

tcp_readyMethod · 0.68