Lines Matching refs:thr
56 struct pthread *thr = (struct pthread *)malloc(sizeof(*thr));
62 if (thr == NULL) {
66 thr->tid = OSGetTID();
67 thr->error = 0;
68 thr->entry = NULL;
69 thr->arg = 0;
74 TAILQ_INSERT_HEAD(&__threads[thr->tid % THREAD_HASH_SLOTS], thr, threadTable);
82 struct pthread *thr;
85 TAILQ_FOREACH(thr, &__threads[tid % THREAD_HASH_SLOTS], threadTable) {
86 if (thr->tid == tid) {
88 return thr;
100 struct pthread *thr = (struct pthread *)arg;
102 thr->result = (thr->entry)(thr->arg);
112 struct pthread *thr;
114 thr = malloc(sizeof(*thr));
115 if (!thr) {
119 memset(thr, 0, sizeof(*thr));
121 thr->entry = start_routine;
122 thr->arg = arg;
124 status = OSThreadCreate((uintptr_t)&pthreadCreateHelper, (uint64_t)thr);
126 free(thr);
130 thr->tid = SYSCALL_VALUE(status);
133 TAILQ_INSERT_HEAD(&__threads[thr->tid % THREAD_HASH_SLOTS], thr, threadTable);
136 *thread = thr;
144 struct pthread *thr = pthread_self();
146 thr->result = value_ptr;
154 struct pthread *thr = thread;
155 uint64_t status = OSThreadWait(0);//thr->tid);
160 *value_ptr = (void *)thr->result;
163 TAILQ_REMOVE(&__threads[thr->tid % THREAD_HASH_SLOTS], thr, threadTable);
167 free(thr);