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

Function test_nested_mutex

lib_acl/samples/thread/thread1/main.c:88–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88static void test_nested_mutex(void)
89{
90 acl_pthread_t tid;
91 acl_pthread_attr_t attr;
92 static acl_pthread_mutex_t mutex;
93
94#ifdef ACL_UNIX
95 pthread_spin_init(&__spin_lock, 0);
96#endif
97
98 acl_pthread_mutex_init(&mutex, NULL);
99 acl_pthread_attr_init(&attr);
100 acl_pthread_attr_setdetachstate(&attr, ACL_PTHREAD_CREATE_DETACHED);
101 acl_pthread_create(&tid, &attr, thread_nested_mutex, &mutex);
102 acl_pthread_create(&tid, &attr, thread_nested_mutex, &mutex);
103}
104
105#ifdef ACL_UNIX
106static pthread_mutex_t mutex_init1 = PTHREAD_MUTEX_INITIALIZER;

Callers 1

mainFunction · 0.85

Calls 4

acl_pthread_mutex_initFunction · 0.85
acl_pthread_attr_initFunction · 0.85
acl_pthread_createFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…