aboutsummaryrefslogtreecommitdiff
path: root/files/de/web/javascript/reference/global_objects/atomics/islockfree/index.html
blob: 61bf90e0bf7edb6ec30dfdcc9f60d2fc6f31a586 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
---
title: Atomics.isLockFree()
slug: Web/JavaScript/Reference/Global_Objects/Atomics/isLockFree
tags:
  - Atomics
  - JavaScript
  - Method
  - Shared Memory
translation_of: Web/JavaScript/Reference/Global_Objects/Atomics/isLockFree
---
<div>{{JSRef}}</div>

<p>Die statische <code><strong>Atomics</strong></code><strong><code>.isLockFree()</code></strong> Methode wird benutzt, um festzustellen, ob ein Lock (Sperre) oder eine atomare Operation vorhanden ist. Sie gibt <code>true</code> zurück, wenn die gegebene Größe eine von den in der <a href="/de/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT">BYTES_PER_ELEMENT</a> Eigenschften von Integer TypedArray Typen ist.</p>

<div>{{EmbedInteractiveExample("pages/js/atomics-islockfree.html")}}</div>



<h2 id="Syntax">Syntax</h2>

<pre class="syntaxbox">Atomics.isLockFree(size)
</pre>

<h3 id="Parameter">Parameter</h3>

<dl>
 <dt><code>size</code></dt>
 <dd>Die größe in Bytes, für die geprüft wird.</dd>
</dl>

<h3 id="Rückgabewert">Rückgabewert</h3>

<p>Ein {{jsxref("Boolean")}}, der angibt, ob die Operation frei von Locks ist.</p>

<h2 id="Beispiele">Beispiele</h2>

<pre class="brush: js">Atomics.isLockFree(1); // true
Atomics.isLockFree(2); // true
Atomics.isLockFree(3); // false
Atomics.isLockFree(4); // true
Atomics.isLockFree(5); // false
Atomics.isLockFree(6); // false
Atomics.isLockFree(7); // false
Atomics.isLockFree(8); // false</pre>

<h2 id="Spezifikationen">Spezifikationen</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Spezifikation</th>
   <th scope="col">Status</th>
   <th scope="col">Kommentar</th>
  </tr>
  <tr>
   <td>{{SpecName('ESDraft', '#sec-atomics.islockfree', 'Atomics.isLockFree')}}</td>
   <td>{{Spec2('ESDraft')}}</td>
   <td>Initiale Definition in ES2017.</td>
  </tr>
 </tbody>
</table>

<h2 id="Browserkompatibilität">Browserkompatibilität</h2>



<p>{{Compat("javascript.builtins.Atomics.isLockFree")}}</p>

<h2 id="Siehe_auch">Siehe auch</h2>

<ul>
 <li>{{jsxref("Atomics")}}</li>
</ul>