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

Use Mutex instead of Semaphore(1) #853

Merged
merged 1 commit into from
Apr 22, 2023
Merged

Conversation

armanbilge
Copy link
Member

No description provided.

new Exchange[F] {
override def apply[A](fa: F[A]): F[A] =
sem.permit.use(_ => fa).uncancelable
mut.lock.surround(fa).uncancelable
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we're here, I wonder about this being .uncancelable. Should the lock acquisition be uncancelable as well? 🤔 or would mut.lock.surround(fa.uncancelable) be sufficient.

@codecov-commenter
Copy link

Codecov Report

Merging #853 (af791d6) into main (9dd4f57) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #853   +/-   ##
=======================================
  Coverage   85.07%   85.07%           
=======================================
  Files         126      126           
  Lines        1742     1742           
  Branches      147      147           
=======================================
  Hits         1482     1482           
  Misses        260      260           
Impacted Files Coverage Δ
.../shared/src/main/scala/net/protocol/Exchange.scala 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@mpilquist mpilquist merged commit d8a4feb into typelevel:main Apr 22, 2023
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.

3 participants