Pinsave/counterstrike
1
1/*! *****************************************************************************2Copyright (c) Microsoft Corporation. All rights reserved.3Licensed under the Apache License, Version 2.0 (the "License"); you may not use4this file except in compliance with the License. You may obtain a copy of the5License at http://www.apache.org/licenses/LICENSE-2.06 7THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY8KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED9WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,10MERCHANTABLITY OR NON-INFRINGEMENT.11 12See the Apache Version 2.0 License for specific language governing permissions13and limitations under the License.14***************************************************************************** */15 16 17/// <reference no-default-lib="true"/>18 19/// <reference lib="es2020.bigint" />20 21interface Atomics {22 /**23 * Adds a value to the value at the given position in the array, returning the original value.24 * Until this atomic operation completes, any other read or write operation against the array25 * will block.26 */27 add(typedArray: BigInt64Array<ArrayBufferLike> | BigUint64Array<ArrayBufferLike>, index: number, value: bigint): bigint;28 29 /**30 * Stores the bitwise AND of a value with the value at the given position in the array,31 * returning the original value. Until this atomic operation completes, any other read or32 * write operation against the array will block.33 */34 and(typedArray: BigInt64Array<ArrayBufferLike> | BigUint64Array<ArrayBufferLike>, index: number, value: bigint): bigint;35 36 /**37 * Replaces the value at the given position in the array if the original value equals the given38 * expected value, returning the original value. Until this atomic operation completes, any39 * other read or write operation against the array will block.40 */41 compareExchange(typedArray: BigInt64Array<ArrayBufferLike> | BigUint64Array<ArrayBufferLike>, index: number, expectedValue: bigint, replacementValue: bigint): bigint;42 43 /**44 * Replaces the value at the given position in the array, returning the original value. Until45 * this atomic operation completes, any other read or write operation against the array will46 * block.47 */48 exchange(typedArray: BigInt64Array<ArrayBufferLike> | BigUint64Array<ArrayBufferLike>, index: number, value: bigint): bigint;49 50 /**51 * Returns the value at the given position in the array. Until this atomic operation completes,52 * any other read or write operation against the array will block.53 */54 load(typedArray: BigInt64Array<ArrayBufferLike> | BigUint64Array<ArrayBufferLike>, index: number): bigint;55 56 /**57 * Stores the bitwise OR of a value with the value at the given position in the array,58 * returning the original value. Until this atomic operation completes, any other read or write59 * operation against the array will block.60 */61 or(typedArray: BigInt64Array<ArrayBufferLike> | BigUint64Array<ArrayBufferLike>, index: number, value: bigint): bigint;62 63 /**64 * Stores a value at the given position in the array, returning the new value. Until this65 * atomic operation completes, any other read or write operation against the array will block.66 */67 store(typedArray: BigInt64Array<ArrayBufferLike> | BigUint64Array<ArrayBufferLike>, index: number, value: bigint): bigint;68 69 /**70 * Subtracts a value from the value at the given position in the array, returning the original71 * value. Until this atomic operation completes, any other read or write operation against the72 * array will block.73 */74 sub(typedArray: BigInt64Array<ArrayBufferLike> | BigUint64Array<ArrayBufferLike>, index: number, value: bigint): bigint;75 76 /**77 * If the value at the given position in the array is equal to the provided value, the current78 * agent is put to sleep causing execution to suspend until the timeout expires (returning79 * `"timed-out"`) or until the agent is awoken (returning `"ok"`); otherwise, returns80 * `"not-equal"`.81 */82 wait(typedArray: BigInt64Array<ArrayBufferLike>, index: number, value: bigint, timeout?: number): "ok" | "not-equal" | "timed-out";83 84 /**85 * Wakes up sleeping agents that are waiting on the given index of the array, returning the86 * number of agents that were awoken.87 * @param typedArray A shared BigInt64Array.88 * @param index The position in the typedArray to wake up on.89 * @param count The number of sleeping agents to notify. Defaults to +Infinity.90 */91 notify(typedArray: BigInt64Array<ArrayBufferLike>, index: number, count?: number): number;92 93 /**94 * Stores the bitwise XOR of a value with the value at the given position in the array,95 * returning the original value. Until this atomic operation completes, any other read or write96 * operation against the array will block.97 */98 xor(typedArray: BigInt64Array<ArrayBufferLike> | BigUint64Array<ArrayBufferLike>, index: number, value: bigint): bigint;99}100 