File tree Expand file tree Collapse file tree 4 files changed +22
-12
lines changed Expand file tree Collapse file tree 4 files changed +22
-12
lines changed Original file line number Diff line number Diff line change @@ -414,6 +414,7 @@ sigs = {
414
414
_wasmfs_opfs_set_size_access__sig : 'vpijp' ,
415
415
_wasmfs_opfs_set_size_file__sig : 'vpijp' ,
416
416
_wasmfs_opfs_write_access__sig : 'iipii' ,
417
+ _wasmfs_thread_utils_heartbeat__sig : 'vp' ,
417
418
abort__sig : 'v' ,
418
419
alBuffer3f__sig : 'viifff' ,
419
420
alBuffer3i__sig : 'viiiii' ,
Original file line number Diff line number Diff line change @@ -416,4 +416,15 @@ FS.createPreloadedFile = FS_createPreloadedFile;
416
416
_wasmfs_copy_preloaded_file_data : function ( index , buffer ) {
417
417
HEAPU8 . set ( wasmFSPreloadedFiles [ index ] . fileData , buffer ) ;
418
418
} ,
419
+
420
+ _wasmfs_thread_utils_heartbeat : ( queue ) => {
421
+ var intervalID =
422
+ setInterval ( ( ) => {
423
+ if ( ABORT ) {
424
+ clearInterval ( intervalID ) ;
425
+ } else {
426
+ _emscripten_proxy_execute_queue ( queue ) ;
427
+ }
428
+ } , 50 ) ;
429
+ } ,
419
430
} ) ;
Original file line number Diff line number Diff line change 13
13
#include < emscripten/proxying.h>
14
14
#include < emscripten/threading.h>
15
15
16
+ extern " C" {
17
+ void _wasmfs_thread_utils_heartbeat (em_proxying_queue* ctx);
18
+ }
19
+
16
20
namespace emscripten {
17
21
18
22
// Helper class for synchronously proxying work to a dedicated worker thread,
@@ -51,16 +55,7 @@ class ProxyWorker {
51
55
//
52
56
// Note that this requires adding _emscripten_proxy_execute_queue to
53
57
// EXPORTED_FUNCTIONS.
54
- EM_ASM ({
55
- var intervalID =
56
- setInterval (() => {
57
- if (ABORT) {
58
- clearInterval (intervalID);
59
- } else {
60
- _emscripten_proxy_execute_queue ($0 );
61
- }
62
- }, 50 );
63
- }, queue.queue );
58
+ _wasmfs_thread_utils_heartbeat (queue.queue );
64
59
65
60
// Sit in the event loop performing work as it comes in.
66
61
emscripten_exit_with_live_runtime ();
Original file line number Diff line number Diff line change @@ -9079,8 +9079,11 @@ def test_js_optimizer_parse_error(self):
9079
9079
});
9080
9080
}
9081
9081
''')
9082
- stderr = self.expect_fail([EMCC, 'src.c', '-O2'])
9083
- # wasm backend output doesn't have spaces in the EM_ASM function bodies
9082
+ stderr = self.expect_fail([EMCC, 'src.c', '-O2'] + self.get_emcc_args())
9083
+ # TODO: To make this test work in WasmFS, the constant below must be
9084
+ # modified. It is the address in memory of the string constant of the
9085
+ # EM_ASM, and WasmFS has its own string constants that cause a
9086
+ # difference.
9084
9087
self.assertContained(('''
9085
9088
1024: () => { var x = !<->5.; }
9086
9089
^
You can’t perform that action at this time.
0 commit comments