Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 0 additions & 3 deletions src/library_pthread_stub.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ var LibraryPThreadStub = {
return !ENVIRONMENT_IS_WORKER;
#endif
},

__cxa_thread_atexit: 'atexit',
__cxa_thread_atexit_impl: 'atexit',
};

mergeInto(LibraryManager.library, LibraryPThreadStub);
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
#include <stdio.h>
#include <stdlib.h>

extern int __cxa_thread_atexit(void (*dtor)(void *), void *obj, void *dso_symbol);
extern int __cxa_thread_atexit_impl(void (*dtor)(void *), void *obj, void *dso_symbol);
extern "C" {
int __cxa_thread_atexit(void (*dtor)(void *), void *obj, void *dso_symbol);
}

static void cleanA() { printf("A\n"); }
static void cleanB() { printf("B\n"); }
Expand All @@ -19,6 +20,5 @@ int main() {
atexit(cleanA);
atexit(cleanB);
__cxa_thread_atexit(cleanCarg, (void*)100, NULL);
__cxa_thread_atexit_impl(cleanCarg, (void*)234, NULL);
return 0;
}
1 change: 0 additions & 1 deletion tests/core/test_atexit_threads.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
C 234
C 100
B
A
9 changes: 7 additions & 2 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2385,10 +2385,15 @@ def test_atexit(self):
self.set_setting('EXIT_RUNTIME')
self.do_core_test('test_atexit.c')

def test_atexit_threads(self):
def test_atexit_threads_stub(self):
# also tests thread exit (__cxa_thread_atexit)
self.set_setting('EXIT_RUNTIME')
self.do_core_test('test_atexit_threads.c')
self.do_core_test('test_atexit_threads.cpp')

@node_pthreads
def test_atexit_threads(self):
self.set_setting('EXIT_RUNTIME')
self.do_core_test('test_atexit_threads.cpp')

@no_asan('test relies on null pointer reads')
def test_pthread_specific(self):
Expand Down