Movatterモバイル変換


[0]ホーム

URL:


  1. 개발자를 위한 웹 기술
  2. JavaScript
  3. JavaScript 참고서
  4. 표준 내장 객체
  5. Atomics
  6. Atomics.isLockFree()

This page was translated from English by the community.Learn more and join the MDN Web Docs community.

View in EnglishAlways switch to English

Atomics.isLockFree()

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨2021년 12월⁩.

Atomics.isLockFree() 정적 메서드는 지정된 요소 바이트 크기를 가진 유형화 배열에 적용될 때Atomics 메서드가 잠금을 사용할지 아니면 아토믹 하드웨어 연산을 사용할지 결정하는 데 사용됩니다.주어진 크기가 정수 타입의 형식화 배열의BYTES_PER_ELEMENT속성 중 하나가 아닌 경우false를 반환합니다.

시도해 보기

console.log(Atomics.isLockFree(3));// 3 is not one of the BYTES_PER_ELEMENT values// Expected output: falseconsole.log(Atomics.isLockFree(4));// 4 is one of the BYTES_PER_ELEMENT values// Expected output: true

구문

js
Atomics.isLockFree(size)

매개변수

size

검사할 바이트 크기

반환 값

해당 연산이 락이 걸렸는지 여부를 가리키는true 혹은false

예제

isLockFree 사용하기

js
Atomics.isLockFree(1); // trueAtomics.isLockFree(2); // trueAtomics.isLockFree(3); // falseAtomics.isLockFree(4); // trueAtomics.isLockFree(5); // falseAtomics.isLockFree(6); // falseAtomics.isLockFree(7); // falseAtomics.isLockFree(8); // true

명세서

Specification
ECMAScript® 2026 Language Specification
# sec-atomics.islockfree

브라우저 호환성

같이 보기

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp