Improve multithreading

This commit is contained in:
Justine Tunney 2024-07-21 06:41:30 -07:00
parent d3167126aa
commit 30afd6ddbb
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
38 changed files with 752 additions and 174 deletions

View file

@ -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();
}