| 107 | static pthread_mutex_t mutex_init2 = PTHREAD_MUTEX_INITIALIZER; |
| 108 | |
| 109 | static void test_thread(void) |
| 110 | { |
| 111 | acl_pthread_t tid; |
| 112 | acl_pthread_attr_t attr; |
| 113 | THREAD_CTX ctx, *pctx; |
| 114 | void *return_arg; |
| 115 | unsigned int id; |
| 116 | |
| 117 | acl_pthread_mutex_lock(&mutex_init1); |
| 118 | printf("lock mutex_init1 ok\n"); |
| 119 | acl_pthread_mutex_lock(&mutex_init2); |
| 120 | printf("lock mutex_init2 ok\n"); |
| 121 | |
| 122 | ctx.i = 0; |
| 123 | acl_pthread_attr_init(&attr); |
| 124 | acl_pthread_create(&tid, &attr, test_thread_fn, &ctx); |
| 125 | acl_pthread_join(tid, (void**) &return_arg); |
| 126 | pctx = (THREAD_CTX*) return_arg; |
| 127 | memcpy(&id, &tid, sizeof(id)); |
| 128 | printf("ctx.i=%d, pctx->i=%d, the thread id is: %u\r\n", |
| 129 | ctx.i, pctx->i, id); |
| 130 | } |
| 131 | #endif |
| 132 | |
| 133 | static void free_vstring(void *arg) |
no test coverage detected
searching dependent graphs…