mailing list of musl libc
 help / color / mirror / code / Atom feed
eb78e2f82dc577b16c0ce48d364abaec97f12409 blob 643 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 
#include "pthread_impl.h"
#include <sys/mman.h>

int __munmap(void *, size_t);
void __pthread_testcancel(void);
int __pthread_setcancelstate(int, int *);

int __pthread_join(pthread_t t, void **res)
{
	int tmp, cs;
	__pthread_testcancel();
	__pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs);
	if (cs == PTHREAD_CANCEL_ENABLE) __pthread_setcancelstate(cs, 0);
	if (!(tmp = t->tid)) a_barrier();
	else do __timedwait_cp(&t->tid, tmp, 0, 0, 0);
	while ((tmp = t->tid));
	__pthread_setcancelstate(cs, 0);
	if (res) *res = t->result;
	if (t->map_base) __munmap(t->map_base, t->map_size);
	return 0;
}

weak_alias(__pthread_join, pthread_join);
debug log:

solving eb78e2f ...
found eb78e2f in https://inbox.vuxu.org/musl/1443477525-24743-1-git-send-email-koorogi@koorogi.info/
found 966b4ab in https://git.vuxu.org/mirror/musl/
preparing index
index prepared:
100644 966b4ab0d11eabf4ab208e44e7ca290a10578c51	src/thread/pthread_join.c

applying [1/1] https://inbox.vuxu.org/musl/1443477525-24743-1-git-send-email-koorogi@koorogi.info/
diff --git a/src/thread/pthread_join.c b/src/thread/pthread_join.c
index 966b4ab..eb78e2f 100644

Checking patch src/thread/pthread_join.c...
Applied patch src/thread/pthread_join.c cleanly.

index at:
100644 eb78e2f82dc577b16c0ce48d364abaec97f12409	src/thread/pthread_join.c

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).