mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 13:52:28 +00:00
Improve pthread_join()
Since we're now on Windows 8, we can have clone() work as advertised on Windows, where it sends a futex wake to the child tid. It's also likely we no longer need to work around thread flakes on OpenBSD, in _wait0().
This commit is contained in:
parent
3733b43a8f
commit
994e1f4386
19 changed files with 154 additions and 74 deletions
|
@ -54,11 +54,16 @@ void TriggerSignal(void) {
|
|||
}
|
||||
|
||||
static void *Increment(void *arg) {
|
||||
ASSERT_EQ(EDEADLK, pthread_join(pthread_self(), 0));
|
||||
ASSERT_EQ(gettid(), pthread_getthreadid_np());
|
||||
TriggerSignal();
|
||||
return (void *)((uintptr_t)arg + 1);
|
||||
}
|
||||
|
||||
TEST(pthread_create, joinSelfDeadlocks) {
|
||||
ASSERT_EQ(EDEADLK, pthread_join(pthread_self(), 0));
|
||||
}
|
||||
|
||||
TEST(pthread_create, testCreateReturnJoin) {
|
||||
void *rc;
|
||||
pthread_t id;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue