Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add re-entry support to synchronized #26

Merged
merged 1 commit into from
Aug 19, 2023
Merged

Add re-entry support to synchronized #26

merged 1 commit into from
Aug 19, 2023

Conversation

kelunik
Copy link
Member

@kelunik kelunik commented Aug 18, 2023

If you have many methods that use synchronized on a single mutex, but they should be able to call each other, it becomes a mess without re-entry support.

This does have the side effect of a slight behavior change in case a Semaphore instead of a Mutex is passed. While a Mutex simply didn't work before, a Semaphore would have consumed two or more locks instead of just one now on nested calls.

@kelunik kelunik requested a review from trowski August 18, 2023 22:08
@trowski trowski merged commit cc440e4 into 2.x Aug 19, 2023
0 of 8 checks passed
@trowski trowski deleted the reentry branch August 19, 2023 13:40
renovate bot added a commit to ben-challis/sql-migrations that referenced this pull request Aug 19, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [amphp/file](https://togithub.com/amphp/file) | require | patch |
`3.0.0-beta.6` -> `3.0.1` |
| [amphp/sync](https://togithub.com/amphp/sync) | require | minor |
`2.0.0` -> `2.1.0` |

---

### ⚠ Dependency Lookup Warnings ⚠

Warnings were logged while processing this repo. Please check the
Dependency Dashboard for more information.

---

### Release Notes

<details>
<summary>amphp/file (amphp/file)</summary>

### [`v3.0.1`](https://togithub.com/amphp/file/releases/tag/v3.0.1):
3.0.1

[Compare
Source](https://togithub.com/amphp/file/compare/v3.0.0...v3.0.1)

#### What's Changed

- Fix `touch()` on non-existent files in ext-uv and ext-eio by
[@&#8203;kelunik](https://togithub.com/kelunik)
([#&#8203;73](https://togithub.com/amphp/file/issues/73))
- Fix `write()` truncation with ext-uv and ext-eio by
[@&#8203;danog](https://togithub.com/danog) in
([#&#8203;76](https://togithub.com/amphp/file/issues/76))

**Full Changelog**:
amphp/file@v3.0.0...v3.0.1

### [`v3.0.0`](https://togithub.com/amphp/file/releases/tag/v3.0.0):
3.0.0

[Compare
Source](https://togithub.com/amphp/file/compare/v3.0.0-beta.6...v3.0.0)

Stable release compatible with AMPHP v3 and fibers! 🎉

As with other libraries compatible with AMPHP v3, most cases of
parameters or returns of `Promise<ResolutionType>` have been replaced
with `ResolutionType`.

-   Renamed `BlockingDriver` to `BlockingFilesystemDriver`
-   Renamed `EioDriver` to `EioFilesystemDriver`
-   Renamed `ParallelDriver` to `ParallelFilesystemDriver`
-   Renamed `StatusCachingDriver` to `StatusCachingFilesystemDriver`
-   Renamed `UvDriver` to `UvFilesystemDriver`
-   Renamed `Amp\File\Sync\AsyncFileMutex` to `Amp\File\FileMutex`
-   Added `?Cancellation` as first parameter of `File::read()`
-   Added `File::isSeekable()`
-   Removed `File::SEEK_SET`, `File::SEEK_CUR`, and `File::SEEK_END`
-   Added `Amp\File\Whence` for seeking instead

</details>

<details>
<summary>amphp/sync (amphp/sync)</summary>

### [`v2.1.0`](https://togithub.com/amphp/sync/releases/tag/v2.1.0):
2.1.0

[Compare
Source](https://togithub.com/amphp/sync/compare/v2.0.0...v2.1.0)

#### What's Changed

- Added re-entry support to `synchronized()` by
[@&#8203;kelunik](https://togithub.com/kelunik) in
[amphp/sync#26
-   Fixed error handling in `SharedMemoryParcel`
- Fixed a typo by [@&#8203;thgs](https://togithub.com/thgs) in
[amphp/sync#25

#### New Contributors

- [@&#8203;thgs](https://togithub.com/thgs) made their first
contribution in
[amphp/sync#25

**Full Changelog**:
amphp/sync@v2.0.0...v2.1.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config help](https://togithub.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/ben-challis/sql-migrations).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi40My4yIiwidXBkYXRlZEluVmVyIjoiMzYuNDMuMiIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants