ObjFW  Diff

Differences From Artifact [7b264a994b]:

To Artifact [de7e15e20a]:


164
165
166
167
168
169
170
171
172


173
174
175
176

177
178
179
180
181
182
183
	return of_tlskey_get(threadKey);
}

bool
of_thread_join(of_thread_t thread)
{
	ObtainSemaphore(&thread->semaphore);
	@try {
		if (thread->done) {


			free(thread);
			return true;
		}


		if (thread->detached || thread->joinTask != NULL) {
			errno = EINVAL;
			return false;
		}

		if ((thread->joinSigBit = AllocSignal(-1)) == -1) {
			errno = EAGAIN;







|
|
>
>
|
|
|

>







164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
	return of_tlskey_get(threadKey);
}

bool
of_thread_join(of_thread_t thread)
{
	ObtainSemaphore(&thread->semaphore);

	if (thread->done) {
		ReleaseSemaphore(&thread->semaphore);

		free(thread);
		return true;
	}

	@try {
		if (thread->detached || thread->joinTask != NULL) {
			errno = EINVAL;
			return false;
		}

		if ((thread->joinSigBit = AllocSignal(-1)) == -1) {
			errno = EAGAIN;