--trace-atomics-wait


稳定性: 0 - 弃用

Atomics.wait() 调用的简短摘要打印到标准错误。 输出可能如下所示:

(node:15701) [Thread 0] Atomics.wait(<address> + 0, 1, inf) started
(node:15701) [Thread 0] Atomics.wait(<address> + 0, 1, inf) did not wait because the values mismatched
(node:15701) [Thread 0] Atomics.wait(<address> + 0, 0, 10) started
(node:15701) [Thread 0] Atomics.wait(<address> + 0, 0, 10) timed out
(node:15701) [Thread 0] Atomics.wait(<address> + 4, 0, inf) started
(node:15701) [Thread 1] Atomics.wait(<address> + 4, -1, inf) started
(node:15701) [Thread 0] Atomics.wait(<address> + 4, 0, inf) was woken up by another thread
(node:15701) [Thread 1] Atomics.wait(<address> + 4, -1, inf) was woken up by another thread

这里的字段对应于:

  • worker_threads.threadId 给定的线程标识
  • 有问题的 SharedArrayBuffer 的基地址,以及传给 Atomics.wait() 的索引对应的字节偏移量
  • 传给 Atomics.wait() 的期望值
  • 传给 Atomics.wait 的超时

Stability: 0 - Deprecated

Print short summaries of calls to Atomics.wait() to stderr. The output could look like this:

(node:15701) [Thread 0] Atomics.wait(<address> + 0, 1, inf) started
(node:15701) [Thread 0] Atomics.wait(<address> + 0, 1, inf) did not wait because the values mismatched
(node:15701) [Thread 0] Atomics.wait(<address> + 0, 0, 10) started
(node:15701) [Thread 0] Atomics.wait(<address> + 0, 0, 10) timed out
(node:15701) [Thread 0] Atomics.wait(<address> + 4, 0, inf) started
(node:15701) [Thread 1] Atomics.wait(<address> + 4, -1, inf) started
(node:15701) [Thread 0] Atomics.wait(<address> + 4, 0, inf) was woken up by another thread
(node:15701) [Thread 1] Atomics.wait(<address> + 4, -1, inf) was woken up by another thread

The fields here correspond to:

  • The thread id as given by worker_threads.threadId
  • The base address of the SharedArrayBuffer in question, as well as the byte offset corresponding to the index passed to Atomics.wait()
  • The expected value that was passed to Atomics.wait()
  • The timeout passed to Atomics.wait