Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions test/tbb/test_tbb_fork.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
Copyright (c) 2005-2022 Intel Corporation
Copyright (c) 2026 UXL Foundation Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -310,9 +311,13 @@ int main()

ASSERT(0, "Hang after fork");
}
// clean pending signals (if any occurs since sigwait)
// clean pending signals (if any occurs since
// sigwait). Should be at most one SIGALRM and
// one SIGCHILD, so 5 iterations should be more
// than enough
sigset_t p_mask;
for (;;) {
int loop = 0;
for (; loop < 5; loop++) {
sigemptyset(&p_mask);
sigpending(&p_mask);
if (sigismember(&p_mask, SIGALRM)
Expand All @@ -321,7 +326,10 @@ int main()
ASSERT(0, "sigwait failed");
} else
break;
sleep(1);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, with limited number of iterations the test is more reliable.

But why do we need sleep() call?

}
if (5 == loop)
ASSERT(0, "sigpending never emptied");
}
}
#endif // _WIN32||_WIN64
Expand Down
Loading