diff options
| author | Ray San <[email protected]> | 2017-10-20 18:24:50 +0200 |
|---|---|---|
| committer | Ray San <[email protected]> | 2017-10-20 18:24:50 +0200 |
| commit | a29365ff2a4e597bf6cb046ea6d51bfa09e1df42 (patch) | |
| tree | ccfdee66ea672a6094167ff0de67a30028302a91 /examples/web/physac/pthread-main.js | |
| parent | 7447deed40f1deabee659155a30b2d6aa454dafd (diff) | |
| download | raylib.com-a29365ff2a4e597bf6cb046ea6d51bfa09e1df42.tar.gz raylib.com-a29365ff2a4e597bf6cb046ea6d51bfa09e1df42.zip | |
Updated all web examples for raylib 1.8
Diffstat (limited to 'examples/web/physac/pthread-main.js')
| -rw-r--r-- | examples/web/physac/pthread-main.js | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/examples/web/physac/pthread-main.js b/examples/web/physac/pthread-main.js index 3f09431..e277f2a 100644 --- a/examples/web/physac/pthread-main.js +++ b/examples/web/physac/pthread-main.js @@ -77,6 +77,9 @@ this.onmessage = function(e) { assert(STACK_MAX > STACK_BASE); Runtime.establishStackSpace(e.data.stackBase, e.data.stackBase + e.data.stackSize); var result = 0; +//#if STACK_OVERFLOW_CHECK + if (typeof writeStackCookie === 'function') writeStackCookie(); +//#endif PThread.receiveObjectTransfer(e.data); @@ -85,11 +88,15 @@ this.onmessage = function(e) { try { // HACK: Some code in the wild has instead signatures of form 'void *ThreadMain()', which seems to be ok in native code. // To emulate supporting both in test suites, use the following form. This is brittle! - if (typeof asm['dynCall_ii'] !== 'undefined') { - result = asm.dynCall_ii(e.data.start_routine, e.data.arg); // pthread entry points are always of signature 'void *ThreadMain(void *arg)' + if (typeof Module['asm']['dynCall_ii'] !== 'undefined') { + result = Module['asm'].dynCall_ii(e.data.start_routine, e.data.arg); // pthread entry points are always of signature 'void *ThreadMain(void *arg)' } else { - result = asm.dynCall_i(e.data.start_routine); // as a hack, try signature 'i' as fallback. + result = Module['asm'].dynCall_i(e.data.start_routine); // as a hack, try signature 'i' as fallback. } +//#if STACK_OVERFLOW_CHECK + if (typeof checkStackCookie === 'function') checkStackCookie(); +//#endif + } catch(e) { if (e === 'Canceled!') { PThread.threadCancel(); |
