Skip to content

Commit

Permalink
Changelog.
Browse files Browse the repository at this point in the history
  • Loading branch information
DirtyHairy committed Sep 2, 2022
1 parent ca09cc6 commit 3d2d987
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 0.4.0

This is a full rewrite of the core implementation.

* Allow negative values for semaphores.
* Allow weights for `semaphore.acquire` and `semaphore.runExclusive`.
A waiter will be dispatched once the value of the semaphore is greater or
equal to its weight.
* Add `semaphore.getValue` and `semaphore.setValue`.
* Allow weights for `semaphore.waitForUnlock`. The promise will only resolve
once the value of the semaphore is greater or equal to its weight.
* Only resolve `waitForUnlock` once no waiters remain (fixes #52).
* `waitForUnlock` times out if the `withTimeout` decorator is used.

## 0.3.2

* Add `waitForUnlock` for waiting until a mutex/semaphore is free for locking,
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ try {

`acquire` returns an (ES6) promise that will resolve as soon as the mutex is
available. The promise resolves with a function `release` that
must be called once the mutex should be released again.
must be called once the mutex should be released again. The `release` callback
is idempotent.

**IMPORTANT:** Failure to call `release` will hold the mutex locked and will
likely deadlock the application. Make sure to call `release` under all circumstances
Expand Down Expand Up @@ -321,7 +322,7 @@ try {
available. The promise resolves to an array with the
first entry being the current value of the semaphore, and the second value a
function that must be called to release the semaphore once the critical operation
has completed.
has completed. The `release` callback is idempotent.

**IMPORTANT:** Failure to call `release` will hold the semaphore locked and will
likely deadlock the application. Make sure to call `release` under all circumstances
Expand Down

0 comments on commit 3d2d987

Please sign in to comment.