Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2021년 12월.
Atomics.wait() 정적 메서드는 Int32Array의 지정된 위치에 지정된 값이 여전히 포함되어 있는지 확인합니다. 만약 그러하다면 잠자기 상태로 있으면서 깨우기(wake-up) 알림을 기다리거나 시간이 만료됩니다. 이 함수는 "ok", "not-equal" 또는 "timed-out" 문자열을 반환합니다.
참고 : 이 연산은 공유 Int32Array 또는 BigInt64Array에서만 작동하며 메인 스레드에서는 허용되지 않을 수 있습니다. 이 메서드의 비차단, 비동기 버전에 대해서는 Atomics.waitAsync()를 참조하세요.
공유된 Int32Array 혹은 BigInt64Array.
indextypedArray에서의 대기하고 있는 인덱스.
value테스트할 기대값.
timeout Optional대기 시간(밀리초). 시간이 명시되지 않으면 Infinity입니다.
"ok", "not-equal" 혹은 "timed-out" 문자열
공유된 Int32Array에서
읽기 스레드는 0이 될 것으로 예상되는 위치 0에서 잠자기 상태로 대기 중입니다. 이 값이 유지되는 한 계속 진행되지 않습니다. 그러나 쓰기 스레드가 새 값을 저장하면 쓰기 스레드에서 알림을 받고 새 값(123)을 반환합니다.
쓰기 스레드는 새 값을 저장하고 쓰기가 완료되면 대기 중인 스레드에 알립니다:
| ECMAScript® 2027 Language Specification # sec-atomics.wait |
Enable JavaScript to view this browser compatibility table.
This page was last modified on 2024년 7월 31일 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.