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
12 changes: 4 additions & 8 deletions src/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -2078,16 +2078,12 @@ addToLibrary({
// at runtime.
$keepRuntimeAlive__deps: ['$runtimeKeepaliveCounter'],
$keepRuntimeAlive: () => noExitRuntime || runtimeKeepaliveCounter > 0,
#elif !EXIT_RUNTIME
// When `noExitRuntime` is not include and EXIT_RUNTIME=0 then we know the
#elif !EXIT_RUNTIME && !PTHREADS
// When `noExitRuntime` is not included and EXIT_RUNTIME=0 then we know the
// runtime can never exit (i.e. should always be kept alive).
// However for pthreads we always default to allowing the runtime to exit
// otherwise threads never exit and are not joinable.
#if PTHREADS
$keepRuntimeAlive: () => !ENVIRONMENT_IS_PTHREAD,
#else
// However, since pthreads themselves always need to be able to exit we
// have to track `runtimeKeepaliveCounter` in that case.
$keepRuntimeAlive: () => true,
#endif
#else
$keepRuntimeAlive__deps: ['$runtimeKeepaliveCounter'],
$keepRuntimeAlive: () => runtimeKeepaliveCounter > 0,
Expand Down
8 changes: 6 additions & 2 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -13640,8 +13640,12 @@ def test_pthread_icu(self):
self.do_other_test('test_pthread_icu.cpp')

@node_pthreads
def test_pthread_set_main_loop(self):
self.do_other_test('test_pthread_set_main_loop.c')
@parameterized({
'': ([],),
'strict': (['-sSTRICT'],),
})
def test_pthread_set_main_loop(self, args):
self.do_other_test('test_pthread_set_main_loop.c', emcc_args=args)

# unistd tests

Expand Down
Loading