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

Function pthread_mutex_init

lib_fiber/c/src/common/pthread_patch.c:316–338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

314}
315
316int pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *mattr)
317{
318 const char *myname = "pthread_mutex_init";
319
320 if (mutex == NULL) {
321 msg_error("%s, %s(%d): input invalid",
322 __FILE__, myname, __LINE__);
323 return -1;
324 }
325
326 mutex->dynamic = 0;
327
328 /* Create the mutex, with initial value signaled */
329 mutex->id = CreateMutex((SECURITY_ATTRIBUTES *) mattr, FALSE, NULL);
330 if (!mutex->id) {
331 msg_error("%s, %s(%d): CreateMutex error(%s)",
332 __FILE__, myname, __LINE__, last_serror());
333 mem_free(mutex);
334 return -1;
335 }
336
337 return 0;
338}
339
340int pthread_mutex_lock(pthread_mutex_t *mutex)
341{

Callers 15

test_lockFunction · 0.85
queue_newFunction · 0.85
mbox_createFunction · 0.85
thread_onceFunction · 0.85
atomic_newFunction · 0.85
sync_timer_newFunction · 0.85
acl_fiber_event_createFunction · 0.85
sync_waiter_newFunction · 0.85
thread_onceFunction · 0.85
acl_fiber_mutex_createFunction · 0.85
thread_onceFunction · 0.85
acl_fiber_cond_createFunction · 0.85

Calls 3

msg_errorFunction · 0.70
last_serrorFunction · 0.70
mem_freeFunction · 0.70

Tested by 1

test_lockFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…