2011-02-12 00:22:29 -05:00
|
|
|
#include "pthread_impl.h"
|
2012-11-08 17:04:20 -05:00
|
|
|
#include <sys/mman.h>
|
2011-02-12 00:22:29 -05:00
|
|
|
|
2014-09-01 00:46:23 +02:00
|
|
|
int __munmap(void *, size_t);
|
|
|
|
|
2011-08-02 21:11:36 -04:00
|
|
|
static void dummy(void *p)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2014-09-01 00:46:23 +02:00
|
|
|
int __pthread_join(pthread_t t, void **res)
|
2011-02-12 00:22:29 -05:00
|
|
|
{
|
2011-09-11 12:35:41 -04:00
|
|
|
int tmp;
|
2014-09-05 03:22:52 -04:00
|
|
|
pthread_testcancel();
|
2011-09-11 12:35:41 -04:00
|
|
|
while ((tmp = t->tid)) __timedwait(&t->tid, tmp, 0, 0, dummy, 0, 0);
|
2011-02-12 00:22:29 -05:00
|
|
|
if (res) *res = t->result;
|
2014-09-01 00:46:23 +02:00
|
|
|
if (t->map_base) __munmap(t->map_base, t->map_size);
|
2011-02-12 00:22:29 -05:00
|
|
|
return 0;
|
|
|
|
}
|
2014-09-01 00:46:23 +02:00
|
|
|
|
|
|
|
weak_alias(__pthread_join, pthread_join);
|