mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-01 02:02:28 +00:00
Improve multithreading
This commit is contained in:
parent
d3167126aa
commit
30afd6ddbb
38 changed files with 752 additions and 174 deletions
|
@ -50,9 +50,8 @@ TEST(pthread_detach, testCreateReturn) {
|
|||
pthread_t id;
|
||||
ASSERT_EQ(0, pthread_create(&id, 0, Increment, 0));
|
||||
ASSERT_EQ(0, pthread_detach(id));
|
||||
while (!pthread_orphan_np()) {
|
||||
_pthread_decimate();
|
||||
}
|
||||
while (!pthread_orphan_np())
|
||||
pthread_decimate_np();
|
||||
}
|
||||
|
||||
TEST(pthread_detach, testDetachUponCreation) {
|
||||
|
@ -62,7 +61,6 @@ TEST(pthread_detach, testDetachUponCreation) {
|
|||
ASSERT_EQ(0, pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED));
|
||||
ASSERT_EQ(0, pthread_create(&th, &attr, Increment, 0));
|
||||
ASSERT_EQ(0, pthread_attr_destroy(&attr));
|
||||
while (!pthread_orphan_np()) {
|
||||
_pthread_decimate();
|
||||
}
|
||||
while (!pthread_orphan_np())
|
||||
pthread_decimate_np();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue