MCPcopy Create free account
hub / github.com/acl-dev/acl / pthread_mutex_lock

Function pthread_mutex_lock

lib_fiber/c/src/common/pthread_patch.c:340–357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

338}
339
340int pthread_mutex_lock(pthread_mutex_t *mutex)
341{
342 const char *myname = "pthread_mutex_lock";
343
344 if (mutex == NULL) {
345 msg_error("%s, %s(%d): input invalid",
346 __FILE__, myname, __LINE__);
347 return -1;
348 }
349
350 if (WaitForSingleObject(mutex->id, INFINITE) == WAIT_FAILED) {
351 msg_error("%s, %s(%d): WaitForSingleObject error(%s)",
352 __FILE__, myname, __LINE__, last_serror());
353 return -1;
354 }
355
356 return 0;
357}
358
359int pthread_mutex_trylock(pthread_mutex_t *mutex)
360{

Callers 15

test_lockFunction · 0.85
fiber_initFunction · 0.85
queue_freeFunction · 0.85
queue_pop_timedwaitFunction · 0.85
queue_pushFunction · 0.85
queue_qlenFunction · 0.85
mbox_send2Function · 0.85
thread_exitFunction · 0.85
pthread_key_createFunction · 0.85
pthread_setspecificFunction · 0.85
atomic_setFunction · 0.85
atomic_casFunction · 0.85

Calls 2

msg_errorFunction · 0.70
last_serrorFunction · 0.70

Tested by 1

test_lockFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…