mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-03-12 08:55:28 +00:00
Fix scenario where the timeout for atomic wait is set to negative number (#1767)
The code, when received -1, performed -1/1000 operation which rounds to 0, i.e. no wait (instead of infinite wait)
This commit is contained in:
parent
8d2aedca77
commit
4cbfeec1f5
|
@ -385,10 +385,8 @@ wasm_runtime_atomic_wait(WASMModuleInstanceCommon *module, void *address,
|
|||
/* condition wait start */
|
||||
os_mutex_lock(&wait_node->wait_lock);
|
||||
|
||||
if (timeout < 0)
|
||||
timeout = BHT_WAIT_FOREVER;
|
||||
os_cond_reltimedwait(&wait_node->wait_cond, &wait_node->wait_lock,
|
||||
timeout / 1000);
|
||||
timeout < 0 ? BHT_WAIT_FOREVER : timeout / 1000);
|
||||
|
||||
os_mutex_unlock(&wait_node->wait_lock);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user