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 Reentrantlock #6373

Merged
merged 7 commits into from
Mar 10, 2022
Merged

Add Reentrantlock #6373

merged 7 commits into from
Mar 10, 2022

Conversation

regiskuckaertz
Copy link
Member

Closes #5807

Is this still relevant? I tried to stick to the java api as much as possible, though I think interruption is so central to zio that it did not make much sense not to handle it by default. Let me know what you think.

@regiskuckaertz
Copy link
Member Author

@adamgfraser hello 👋 if you're happy with that I can port to the 2.x branch afterwards.

@adamgfraser
Copy link
Contributor

@regiskuckaertz Will take a look today!

@adamgfraser
Copy link
Contributor

This looks good. I think the big question here is whether we want this to be its own bespoke data structure or a type alias for the existing TReentrantLock similar to what we did with Semaphore and TSemaphore.

@regiskuckaertz
Copy link
Member Author

Yeah I thought about that, I wasn't really sure what to do tbh, but happy to do it that way instead. Is it still the intent to match the JDK API or not?

@adamgfraser
Copy link
Contributor

I think if we did that we definitely wouldn't match the Java API. My initial thought would have been to just alias TReentrantLock but since we have already done the work on this happy to go either way.

@regiskuckaertz
Copy link
Member Author

I'm tempted to say on the surface the datatypes in zio.concurrent currently are very close to the jdk, and that using STM under the hood feels like an implementation detail. Can we go that way and see how it pans out?

@regiskuckaertz
Copy link
Member Author

@adamgfraser ping 😇

@adamgfraser
Copy link
Contributor

@regiskuckaertz Sure!

@adamgfraser adamgfraser merged commit e4c7b62 into zio:master Mar 10, 2022
regiskuckaertz added a commit to regiskuckaertz/zio that referenced this pull request Apr 2, 2022
* Add ReentrantLock

* Release interrupted fibers

* Fix for 2.12

* Mark as flaky

* Can't always nudge the fiber the right way

* Refactor test

Co-authored-by: Regis Kuckaertz <regiskuckaertz@users.noreply.github.com>
regiskuckaertz added a commit that referenced this pull request Apr 2, 2022
* Add Reentrantlock (#6373)

* Add ReentrantLock

* Release interrupted fibers

* Fix for 2.12

* Mark as flaky

* Can't always nudge the fiber the right way

* Refactor test

Co-authored-by: Regis Kuckaertz <regiskuckaertz@users.noreply.github.com>

* Rewrite with 2.0 idioms

Co-authored-by: Regis Kuckaertz <regiskuckaertz@users.noreply.github.com>
@regiskuckaertz regiskuckaertz deleted the rk-reentrentlock branch November 25, 2023 14:57
@regiskuckaertz regiskuckaertz restored the rk-reentrentlock branch November 25, 2023 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ReentrantLock
2 participants