Skip to content

Commit 3208408

Browse files
Merge branch 'main' into warp
2 parents d646ee4 + 1100dbe commit 3208408

File tree

3 files changed

+29
-8
lines changed

3 files changed

+29
-8
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: 'Conventional Commit'
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
# Defaults
7+
# https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request_target
8+
- opened
9+
- reopened
10+
- synchronize
11+
# Tracks editing PR title or description, or base branch changes
12+
# https://docs.github.com/en/webhooks/webhook-events-and-payloads?actionType=edited#pull_request
13+
- edited
14+
15+
jobs:
16+
main:
17+
name: '[Required] Validate PR title'
18+
runs-on: ubuntu-latest
19+
permissions:
20+
pull-requests: read
21+
steps:
22+
- uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6.1.1
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/presubmit.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010

1111
jobs:
1212
check-format:
13+
name: '[Required] Check correct format'
1314
runs-on: ubuntu-latest
1415

1516
steps:
@@ -31,6 +32,7 @@ jobs:
3132
run: npm run check-format
3233

3334
check-docs:
35+
name: '[Required] Check docs updated'
3436
runs-on: ubuntu-latest
3537

3638
steps:

src/Mutex.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,10 @@
77
export class Mutex {
88
static Guard = class Guard {
99
#mutex: Mutex;
10-
#onRelease?: () => void;
11-
constructor(mutex: Mutex, onRelease?: () => void) {
10+
constructor(mutex: Mutex) {
1211
this.#mutex = mutex;
13-
this.#onRelease = onRelease;
1412
}
1513
dispose(): void {
16-
this.#onRelease?.();
1714
return this.#mutex.release();
1815
}
1916
};
@@ -22,17 +19,15 @@ export class Mutex {
2219
#acquirers: Array<() => void> = [];
2320

2421
// This is FIFO.
25-
async acquire(
26-
onRelease?: () => void,
27-
): Promise<InstanceType<typeof Mutex.Guard>> {
22+
async acquire(): Promise<InstanceType<typeof Mutex.Guard>> {
2823
if (!this.#locked) {
2924
this.#locked = true;
3025
return new Mutex.Guard(this);
3126
}
3227
const {resolve, promise} = Promise.withResolvers<void>();
3328
this.#acquirers.push(resolve);
3429
await promise;
35-
return new Mutex.Guard(this, onRelease);
30+
return new Mutex.Guard(this);
3631
}
3732

3833
release(): void {

0 commit comments

Comments
 (0)