@@ -258,18 +258,18 @@ const emnapiTSFN = {
258258 const i32a = new Int32Array ( wasmMemory . buffer , index , 1 )
259259 if ( isBrowserMain ) {
260260 while ( true ) {
261- const oldValue = Atomics . compareExchange ( i32a , 0 , 0 , 1 )
261+ const oldValue = Atomics . compareExchange ( i32a , 0 , 0 , 10 )
262262 if ( oldValue === 0 ) {
263263 return
264264 }
265265 }
266266 } else {
267267 while ( true ) {
268- const oldValue = Atomics . compareExchange ( i32a , 0 , 0 , 1 )
268+ const oldValue = Atomics . compareExchange ( i32a , 0 , 0 , 10 )
269269 if ( oldValue === 0 ) {
270270 return
271271 }
272- Atomics . wait ( i32a , 0 , 1 )
272+ Atomics . wait ( i32a , 0 , 10 )
273273 }
274274 }
275275 } ,
@@ -278,20 +278,20 @@ const emnapiTSFN = {
278278 const again = (): void => { fn() }
279279 const fn = (): void => {
280280 const i32a = new Int32Array(wasmMemory.buffer, index, 1)
281- const oldValue = Atomics.compareExchange(i32a, 0, 0, 1 )
281+ const oldValue = Atomics.compareExchange(i32a, 0, 0, 10 )
282282 if (oldValue === 0) {
283283 resolve()
284284 return
285285 }
286- (Atomics as any).waitAsync(i32a, 0, 1 ).value.then(again)
286+ (Atomics as any).waitAsync(i32a, 0, 10 ).value.then(again)
287287 }
288288 fn()
289289 })
290290 }, */
291291 unlock ( ) {
292292 const i32a = new Int32Array ( wasmMemory . buffer , index , 1 )
293- const oldValue = Atomics . compareExchange ( i32a , 0 , 1 , 0 )
294- if ( oldValue !== 1 ) {
293+ const oldValue = Atomics . compareExchange ( i32a , 0 , 10 , 0 )
294+ if ( oldValue !== 10 ) {
295295 throw new Error ( 'Tried to unlock while not holding the mutex' )
296296 }
297297 Atomics . notify ( i32a , 0 , 1 )
0 commit comments