神岛 API 文档 - ArenaPro版
    Preparing search index...
    interface Atomics {
        "[toStringTag]": "Atomics";
        add(
            typedArray:
                | Uint8Array<ArrayBufferLike>
                | Int8Array<ArrayBufferLike>
                | Int16Array<ArrayBufferLike>
                | Uint16Array<ArrayBufferLike>
                | Int32Array<ArrayBufferLike>
                | Uint32Array<ArrayBufferLike>,
            index: number,
            value: number,
        ): number;
        add(
            typedArray:
                | BigInt64Array<ArrayBufferLike>
                | BigUint64Array<ArrayBufferLike>,
            index: number,
            value: bigint,
        ): bigint;
        add(
            typedArray:
                | Uint8Array<ArrayBufferLike>
                | Int8Array<ArrayBufferLike>
                | Int16Array<ArrayBufferLike>
                | Uint16Array<ArrayBufferLike>
                | Int32Array<ArrayBufferLike>
                | Uint32Array<ArrayBufferLike>,
            index: number,
            value: number,
        ): number;
        and(
            typedArray:
                | Uint8Array<ArrayBufferLike>
                | Int8Array<ArrayBufferLike>
                | Int16Array<ArrayBufferLike>
                | Uint16Array<ArrayBufferLike>
                | Int32Array<ArrayBufferLike>
                | Uint32Array<ArrayBufferLike>,
            index: number,
            value: number,
        ): number;
        and(
            typedArray:
                | BigInt64Array<ArrayBufferLike>
                | BigUint64Array<ArrayBufferLike>,
            index: number,
            value: bigint,
        ): bigint;
        and(
            typedArray:
                | Uint8Array<ArrayBufferLike>
                | Int8Array<ArrayBufferLike>
                | Int16Array<ArrayBufferLike>
                | Uint16Array<ArrayBufferLike>
                | Int32Array<ArrayBufferLike>
                | Uint32Array<ArrayBufferLike>,
            index: number,
            value: number,
        ): number;
        compareExchange(
            typedArray:
                | Uint8Array<ArrayBufferLike>
                | Int8Array<ArrayBufferLike>
                | Int16Array<ArrayBufferLike>
                | Uint16Array<ArrayBufferLike>
                | Int32Array<ArrayBufferLike>
                | Uint32Array<ArrayBufferLike>,
            index: number,
            expectedValue: number,
            replacementValue: number,
        ): number;
        compareExchange(
            typedArray:
                | BigInt64Array<ArrayBufferLike>
                | BigUint64Array<ArrayBufferLike>,
            index: number,
            expectedValue: bigint,
            replacementValue: bigint,
        ): bigint;
        compareExchange(
            typedArray:
                | Uint8Array<ArrayBufferLike>
                | Int8Array<ArrayBufferLike>
                | Int16Array<ArrayBufferLike>
                | Uint16Array<ArrayBufferLike>
                | Int32Array<ArrayBufferLike>
                | Uint32Array<ArrayBufferLike>,
            index: number,
            expectedValue: number,
            replacementValue: number,
        ): number;
        exchange(
            typedArray:
                | Uint8Array<ArrayBufferLike>
                | Int8Array<ArrayBufferLike>
                | Int16Array<ArrayBufferLike>
                | Uint16Array<ArrayBufferLike>
                | Int32Array<ArrayBufferLike>
                | Uint32Array<ArrayBufferLike>,
            index: number,
            value: number,
        ): number;
        exchange(
            typedArray:
                | BigInt64Array<ArrayBufferLike>
                | BigUint64Array<ArrayBufferLike>,
            index: number,
            value: bigint,
        ): bigint;
        exchange(
            typedArray:
                | Uint8Array<ArrayBufferLike>
                | Int8Array<ArrayBufferLike>
                | Int16Array<ArrayBufferLike>
                | Uint16Array<ArrayBufferLike>
                | Int32Array<ArrayBufferLike>
                | Uint32Array<ArrayBufferLike>,
            index: number,
            value: number,
        ): number;
        isLockFree(size: number): boolean;
        isLockFree(size: number): boolean;
        load(
            typedArray:
                | Uint8Array<ArrayBufferLike>
                | Int8Array<ArrayBufferLike>
                | Int16Array<ArrayBufferLike>
                | Uint16Array<ArrayBufferLike>
                | Int32Array<ArrayBufferLike>
                | Uint32Array<ArrayBufferLike>,
            index: number,
        ): number;
        load(
            typedArray:
                | BigInt64Array<ArrayBufferLike>
                | BigUint64Array<ArrayBufferLike>,
            index: number,
        ): bigint;
        load(
            typedArray:
                | Uint8Array<ArrayBufferLike>
                | Int8Array<ArrayBufferLike>
                | Int16Array<ArrayBufferLike>
                | Uint16Array<ArrayBufferLike>
                | Int32Array<ArrayBufferLike>
                | Uint32Array<ArrayBufferLike>,
            index: number,
        ): number;
        notify(
            typedArray: Int32Array<ArrayBufferLike>,
            index: number,
            count?: number,
        ): number;
        notify(
            typedArray: BigInt64Array<ArrayBufferLike>,
            index: number,
            count?: number,
        ): number;
        notify(typedArray: Int32Array, index: number, count: number): number;
        or(
            typedArray:
                | Uint8Array<ArrayBufferLike>
                | Int8Array<ArrayBufferLike>
                | Int16Array<ArrayBufferLike>
                | Uint16Array<ArrayBufferLike>
                | Int32Array<ArrayBufferLike>
                | Uint32Array<ArrayBufferLike>,
            index: number,
            value: number,
        ): number;
        or(
            typedArray:
                | BigInt64Array<ArrayBufferLike>
                | BigUint64Array<ArrayBufferLike>,
            index: number,
            value: bigint,
        ): bigint;
        or(
            typedArray:
                | Uint8Array<ArrayBufferLike>
                | Int8Array<ArrayBufferLike>
                | Int16Array<ArrayBufferLike>
                | Uint16Array<ArrayBufferLike>
                | Int32Array<ArrayBufferLike>
                | Uint32Array<ArrayBufferLike>,
            index: number,
            value: number,
        ): number;
        store(
            typedArray:
                | Uint8Array<ArrayBufferLike>
                | Int8Array<ArrayBufferLike>
                | Int16Array<ArrayBufferLike>
                | Uint16Array<ArrayBufferLike>
                | Int32Array<ArrayBufferLike>
                | Uint32Array<ArrayBufferLike>,
            index: number,
            value: number,
        ): number;
        store(
            typedArray:
                | BigInt64Array<ArrayBufferLike>
                | BigUint64Array<ArrayBufferLike>,
            index: number,
            value: bigint,
        ): bigint;
        store(
            typedArray:
                | Uint8Array<ArrayBufferLike>
                | Int8Array<ArrayBufferLike>
                | Int16Array<ArrayBufferLike>
                | Uint16Array<ArrayBufferLike>
                | Int32Array<ArrayBufferLike>
                | Uint32Array<ArrayBufferLike>,
            index: number,
            value: number,
        ): number;
        sub(
            typedArray:
                | Uint8Array<ArrayBufferLike>
                | Int8Array<ArrayBufferLike>
                | Int16Array<ArrayBufferLike>
                | Uint16Array<ArrayBufferLike>
                | Int32Array<ArrayBufferLike>
                | Uint32Array<ArrayBufferLike>,
            index: number,
            value: number,
        ): number;
        sub(
            typedArray:
                | BigInt64Array<ArrayBufferLike>
                | BigUint64Array<ArrayBufferLike>,
            index: number,
            value: bigint,
        ): bigint;
        sub(
            typedArray:
                | Uint8Array<ArrayBufferLike>
                | Int8Array<ArrayBufferLike>
                | Int16Array<ArrayBufferLike>
                | Uint16Array<ArrayBufferLike>
                | Int32Array<ArrayBufferLike>
                | Uint32Array<ArrayBufferLike>,
            index: number,
            value: number,
        ): number;
        wait(
            typedArray: Int32Array<ArrayBufferLike>,
            index: number,
            value: number,
            timeout?: number,
        ): "ok" | "not-equal" | "timed-out";
        wait(
            typedArray: BigInt64Array<ArrayBufferLike>,
            index: number,
            value: bigint,
            timeout?: number,
        ): "ok" | "not-equal" | "timed-out";
        wait(
            typedArray: Int32Array,
            index: number,
            value: number,
            timeout?: number,
        ): "ok" | "not-equal" | "timed-out";
        xor(
            typedArray:
                | Uint8Array<ArrayBufferLike>
                | Int8Array<ArrayBufferLike>
                | Int16Array<ArrayBufferLike>
                | Uint16Array<ArrayBufferLike>
                | Int32Array<ArrayBufferLike>
                | Uint32Array<ArrayBufferLike>,
            index: number,
            value: number,
        ): number;
        xor(
            typedArray:
                | BigInt64Array<ArrayBufferLike>
                | BigUint64Array<ArrayBufferLike>,
            index: number,
            value: bigint,
        ): bigint;
        xor(
            typedArray:
                | Uint8Array<ArrayBufferLike>
                | Int8Array<ArrayBufferLike>
                | Int16Array<ArrayBufferLike>
                | Uint16Array<ArrayBufferLike>
                | Int32Array<ArrayBufferLike>
                | Uint32Array<ArrayBufferLike>,
            index: number,
            value: number,
        ): number;
    }
    Index

    Properties

    "[toStringTag]": "Atomics"

    Methods

    • Adds a value to the value at the given position in the array, returning the original value. Until this atomic operation completes, any other read or write operation against the array will block.

      Parameters

      Returns number

    • Adds a value to the value at the given position in the array, returning the original value. Until this atomic operation completes, any other read or write operation against the array will block.

      Parameters

      Returns bigint

    • Adds a value to the value at the given position in the array, returning the original value. Until this atomic operation completes, any other read or write operation against the array will block.

      Parameters

      Returns number

    • Stores the bitwise AND of a value with the value at the given position in the array, returning the original value. Until this atomic operation completes, any other read or write operation against the array will block.

      Parameters

      Returns number

    • Stores the bitwise AND of a value with the value at the given position in the array, returning the original value. Until this atomic operation completes, any other read or write operation against the array will block.

      Parameters

      Returns bigint

    • Stores the bitwise AND of a value with the value at the given position in the array, returning the original value. Until this atomic operation completes, any other read or write operation against the array will block.

      Parameters

      Returns number

    • Replaces the value at the given position in the array if the original value equals the given expected value, returning the original value. Until this atomic operation completes, any other read or write operation against the array will block.

      Parameters

      Returns number

    • Replaces the value at the given position in the array if the original value equals the given expected value, returning the original value. Until this atomic operation completes, any other read or write operation against the array will block.

      Parameters

      Returns bigint

    • Replaces the value at the given position in the array if the original value equals the given expected value, returning the original value. Until this atomic operation completes, any other read or write operation against the array will block.

      Parameters

      Returns number

    • Replaces the value at the given position in the array, returning the original value. Until this atomic operation completes, any other read or write operation against the array will block.

      Parameters

      Returns number

    • Replaces the value at the given position in the array, returning the original value. Until this atomic operation completes, any other read or write operation against the array will block.

      Parameters

      Returns bigint

    • Replaces the value at the given position in the array, returning the original value. Until this atomic operation completes, any other read or write operation against the array will block.

      Parameters

      Returns number

    • Returns a value indicating whether high-performance algorithms can use atomic operations (true) or must use locks (false) for the given number of bytes-per-element of a typed array.

      Parameters

      • size: number

      Returns boolean

    • Returns a value indicating whether high-performance algorithms can use atomic operations (true) or must use locks (false) for the given number of bytes-per-element of a typed array.

      Parameters

      • size: number

      Returns boolean

    • Returns the value at the given position in the array. Until this atomic operation completes, any other read or write operation against the array will block.

      Parameters

      Returns number

    • Returns the value at the given position in the array. Until this atomic operation completes, any other read or write operation against the array will block.

      Parameters

      Returns bigint

    • Returns the value at the given position in the array. Until this atomic operation completes, any other read or write operation against the array will block.

      Parameters

      Returns number

    • Wakes up sleeping agents that are waiting on the given index of the array, returning the number of agents that were awoken.

      Parameters

      • typedArray: Int32Array<ArrayBufferLike>

        A shared Int32Array.

      • index: number

        The position in the typedArray to wake up on.

      • Optionalcount: number

        The number of sleeping agents to notify. Defaults to +Infinity.

      Returns number

    • Wakes up sleeping agents that are waiting on the given index of the array, returning the number of agents that were awoken.

      Parameters

      • typedArray: BigInt64Array<ArrayBufferLike>

        A shared BigInt64Array.

      • index: number

        The position in the typedArray to wake up on.

      • Optionalcount: number

        The number of sleeping agents to notify. Defaults to +Infinity.

      Returns number

    • Wakes up sleeping agents that are waiting on the given index of the array, returning the number of agents that were awoken.

      Parameters

      Returns number

    • Stores the bitwise OR of a value with the value at the given position in the array, returning the original value. Until this atomic operation completes, any other read or write operation against the array will block.

      Parameters

      Returns number

    • Stores the bitwise OR of a value with the value at the given position in the array, returning the original value. Until this atomic operation completes, any other read or write operation against the array will block.

      Parameters

      Returns bigint

    • Stores the bitwise OR of a value with the value at the given position in the array, returning the original value. Until this atomic operation completes, any other read or write operation against the array will block.

      Parameters

      Returns number

    • Stores a value at the given position in the array, returning the new value. Until this atomic operation completes, any other read or write operation against the array will block.

      Parameters

      Returns number

    • Stores a value at the given position in the array, returning the new value. Until this atomic operation completes, any other read or write operation against the array will block.

      Parameters

      Returns bigint

    • Stores a value at the given position in the array, returning the new value. Until this atomic operation completes, any other read or write operation against the array will block.

      Parameters

      Returns number

    • Subtracts a value from the value at the given position in the array, returning the original value. Until this atomic operation completes, any other read or write operation against the array will block.

      Parameters

      Returns number

    • Subtracts a value from the value at the given position in the array, returning the original value. Until this atomic operation completes, any other read or write operation against the array will block.

      Parameters

      Returns bigint

    • Subtracts a value from the value at the given position in the array, returning the original value. Until this atomic operation completes, any other read or write operation against the array will block.

      Parameters

      Returns number

    • If the value at the given position in the array is equal to the provided value, the current agent is put to sleep causing execution to suspend until the timeout expires (returning "timed-out") or until the agent is awoken (returning "ok"); otherwise, returns "not-equal".

      Parameters

      • typedArray: Int32Array<ArrayBufferLike>
      • index: number
      • value: number
      • Optionaltimeout: number

      Returns "ok" | "not-equal" | "timed-out"

    • If the value at the given position in the array is equal to the provided value, the current agent is put to sleep causing execution to suspend until the timeout expires (returning "timed-out") or until the agent is awoken (returning "ok"); otherwise, returns "not-equal".

      Parameters

      • typedArray: BigInt64Array<ArrayBufferLike>
      • index: number
      • value: bigint
      • Optionaltimeout: number

      Returns "ok" | "not-equal" | "timed-out"

    • If the value at the given position in the array is equal to the provided value, the current agent is put to sleep causing execution to suspend until the timeout expires (returning "timed-out") or until the agent is awoken (returning "ok"); otherwise, returns "not-equal".

      Parameters

      • typedArray: Int32Array
      • index: number
      • value: number
      • Optionaltimeout: number

      Returns "ok" | "not-equal" | "timed-out"

    • Stores the bitwise XOR of a value with the value at the given position in the array, returning the original value. Until this atomic operation completes, any other read or write operation against the array will block.

      Parameters

      Returns number

    • Stores the bitwise XOR of a value with the value at the given position in the array, returning the original value. Until this atomic operation completes, any other read or write operation against the array will block.

      Parameters

      Returns bigint

    • Stores the bitwise XOR of a value with the value at the given position in the array, returning the original value. Until this atomic operation completes, any other read or write operation against the array will block.

      Parameters

      Returns number