1 /*! *****************************************************************************
2 Copyright (c) Microsoft Corporation. All rights reserved.
3 Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4 this file except in compliance with the License. You may obtain a copy of the
5 License at http://www.apache.org/licenses/LICENSE-2.0
7 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8 KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
9 WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
10 MERCHANTABLITY OR NON-INFRINGEMENT.
12 See the Apache Version 2.0 License for specific language governing permissions
13 and limitations under the License.
14 ***************************************************************************** */
18 /// <reference no-default-lib="true"/>
\r
23 * Adds a value to the value at the given position in the array, returning the original value.
\r
24 * Until this atomic operation completes, any other read or write operation against the array
\r
27 add(typedArray: BigInt64Array | BigUint64Array, index: number, value: bigint): bigint;
\r
30 * Stores the bitwise AND of a value with the value at the given position in the array,
\r
31 * returning the original value. Until this atomic operation completes, any other read or
\r
32 * write operation against the array will block.
\r
34 and(typedArray: BigInt64Array | BigUint64Array, index: number, value: bigint): bigint;
\r
37 * Replaces the value at the given position in the array if the original value equals the given
\r
38 * expected value, returning the original value. Until this atomic operation completes, any
\r
39 * other read or write operation against the array will block.
\r
41 compareExchange(typedArray: BigInt64Array | BigUint64Array, index: number, expectedValue: bigint, replacementValue: bigint): bigint;
\r
44 * Replaces the value at the given position in the array, returning the original value. Until
\r
45 * this atomic operation completes, any other read or write operation against the array will
\r
48 exchange(typedArray: BigInt64Array | BigUint64Array, index: number, value: bigint): bigint;
\r
51 * Returns the value at the given position in the array. Until this atomic operation completes,
\r
52 * any other read or write operation against the array will block.
\r
54 load(typedArray: BigInt64Array | BigUint64Array, index: number): bigint;
\r
57 * Stores the bitwise OR of a value with the value at the given position in the array,
\r
58 * returning the original value. Until this atomic operation completes, any other read or write
\r
59 * operation against the array will block.
\r
61 or(typedArray: BigInt64Array | BigUint64Array, index: number, value: bigint): bigint;
\r
64 * Stores a value at the given position in the array, returning the new value. Until this
\r
65 * atomic operation completes, any other read or write operation against the array will block.
\r
67 store(typedArray: BigInt64Array | BigUint64Array, index: number, value: bigint): bigint;
\r
70 * Subtracts a value from the value at the given position in the array, returning the original
\r
71 * value. Until this atomic operation completes, any other read or write operation against the
\r
74 sub(typedArray: BigInt64Array | BigUint64Array, index: number, value: bigint): bigint;
\r
77 * If the value at the given position in the array is equal to the provided value, the current
\r
78 * agent is put to sleep causing execution to suspend until the timeout expires (returning
\r
79 * `"timed-out"`) or until the agent is awoken (returning `"ok"`); otherwise, returns
\r
82 wait(typedArray: BigInt64Array, index: number, value: bigint, timeout?: number): "ok" | "not-equal" | "timed-out";
\r
85 * Wakes up sleeping agents that are waiting on the given index of the array, returning the
\r
86 * number of agents that were awoken.
\r
87 * @param typedArray A shared BigInt64Array.
\r
88 * @param index The position in the typedArray to wake up on.
\r
89 * @param count The number of sleeping agents to notify. Defaults to +Infinity.
\r
91 notify(typedArray: BigInt64Array, index: number, count?: number): number;
\r
94 * Stores the bitwise XOR of a value with the value at the given position in the array,
\r
95 * returning the original value. Until this atomic operation completes, any other read or write
\r
96 * operation against the array will block.
\r
98 xor(typedArray: BigInt64Array | BigUint64Array, index: number, value: bigint): bigint;
\r