Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F162396603
D55893.id173808.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D55893.id173808.diff
View Options
diff --git a/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc b/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc
--- a/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc
+++ b/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc
@@ -76,11 +76,16 @@
extern "C" int __cxa_thread_atexit(void (*)(void *), void *, void *);
+#define AGAIN_CALL_ROUND 20
+static int again_counter = 0;
+
static void
again(void *arg)
{
-
- __cxa_thread_atexit(again, arg, &output);
+ if (again_counter < 20) {
+ again_counter++;
+ __cxa_thread_atexit(again, arg, &output);
+ }
}
ATF_TEST_CASE_WITHOUT_HEAD(cxx__thread_inf_dtors);
diff --git a/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc b/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc
--- a/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc
+++ b/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc
@@ -30,7 +30,10 @@
#include <cstdlib>
#include <thread>
+#define AGAIN_CALL_ROUND 20
+
static FILE *output = NULL;
+static int again_counter = 0;
struct Foo {
Foo() { ATF_REQUIRE(fprintf(output, "Created\n") > 0); }
@@ -52,8 +55,10 @@
static void
again(void *arg)
{
-
- __cxa_thread_atexit(again, arg, &output);
+ if (again_counter < AGAIN_CALL_ROUND) {
+ ++again_counter;
+ __cxa_thread_atexit(again, arg, &output);
+ }
}
struct Baz {
@@ -164,6 +169,7 @@
std::thread t([]() { e.use(); });
t.join();
+ ATF_REQUIRE_EQ(again_counter, AGAIN_CALL_ROUND);
}
ATF_INIT_TEST_CASES(tcs)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jul 13, 8:34 PM (11 h, 52 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35044631
Default Alt Text
D55893.id173808.diff (1 KB)
Attached To
Mode
D55893: libc: Fix cxa_thread_atexit test.
Attached
Detach File
Event Timeline
Log In to Comment