Skip to content

Commit

Permalink
🔀 Merge branch 'devel' into release
Browse files Browse the repository at this point in the history
- Node.js v14.x is supported
  - SharedArrayBuffer is also used with Uint8Array

Signed-off-by: kei-g <km.8k6ce+github@gmail.com>
  • Loading branch information
kei-g committed Aug 23, 2021
2 parents cb49b27 + 88906ec commit 147f315
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion async-iterable-queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@ export class AsyncIterableQueue<T> implements AsyncIterable<T> {
/**
* この待ち行列の現在の状態
*/
readonly #state = new Uint8Array([AIQState.undefined])
readonly #state = new Uint8Array(new SharedArrayBuffer(1))

/**
* コンストラクタ
*/
constructor() {
this.#state[0] = AIQState.undefined
const resolveAsync = createAsyncResolver({
finish: () => Atomics.exchange(this.#state, 0, AIQState.finished),
resolvers: this.#resolvers,
Expand Down

0 comments on commit 147f315

Please sign in to comment.