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

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

int __munmap(void *, size_t);


/* We have to be careful to not modify memory at res[1], which we
 * might do on 64 bit archs, if we'd just interpret *res (an int) as
 * void*. Therefore this can't be a simple tail call to
 * __pthread_join.
 *
 * As additional bonus, C11 threads cannot be canceled, so there is no
 * need for a cancelation function pointer, here. */
int thrd_join(thrd_t t, int *res)
{
	int tmp;
	while ((tmp = t->tid)) __timedwait(&t->tid, tmp, 0, 0, 0, 0, 0);
	if (res) *res = (int)(intptr_t)t->result;
	if (t->map_base) __munmap(t->map_base, t->map_size);
	return thrd_success;
}
debug log:

solving d690676 ...
found d690676 in https://inbox.vuxu.org/musl/1e0e284e514b7a25ee75056617db64a051b3f3c2.1409524413.git.Jens.Gustedt@inria.fr/
found ac66789 in https://git.vuxu.org/mirror/musl/
preparing index
index prepared:
100644 ac6678939f6b3436818936eaf56b395479c4f3c2	src/thread/thrd_join.c

applying [1/1] https://inbox.vuxu.org/musl/1e0e284e514b7a25ee75056617db64a051b3f3c2.1409524413.git.Jens.Gustedt@inria.fr/
diff --git a/src/thread/thrd_join.c b/src/thread/thrd_join.c
index ac66789..d690676 100644

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

index at:
100644 d69067610066ae9dbdec1b3dcf9ce69bd7a80f4c	src/thread/thrd_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).