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

@ -151,23 +151,20 @@ int main(int argc, char *argv[]) {
a->teardown(0);
}
}
if (_weaken(TearDownOnce)) {
if (_weaken(TearDownOnce))
_weaken(TearDownOnce)();
}
// make sure threads are in a good state
if (_weaken(_pthread_decimate)) {
_weaken(_pthread_decimate)();
}
if (_weaken(_pthread_decimate))
_weaken(_pthread_decimate)(false);
if (_weaken(pthread_orphan_np) && !_weaken(pthread_orphan_np)()) {
tinyprint(2, "error: tests ended with threads still active\n", NULL);
_Exit(1);
}
// check for memory leaks
if (!g_testlib_failed) {
if (!g_testlib_failed)
CheckForMemoryLeaks();
}
// we're done!
int status = MIN(255, g_testlib_failed);