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 Lock to std #3535

Open
armanbilge opened this issue Apr 15, 2023 · 3 comments · May be fixed by #3542
Open

Add Lock to std #3535

armanbilge opened this issue Apr 15, 2023 · 3 comments · May be fixed by #3542

Comments

@armanbilge
Copy link
Member

Spinning out of #3480 (comment).

The API would look something like:

abstract class Lock[F[_]] {
  def shared: Resource[F, Unit]
  def exclusive: Resource[F, Unit]
}
@ChristopherDavenport
Copy link
Member

https://github.com/davenverse/lock - Available as some prior art.

@djspiewak
Copy link
Member

…with the caveat that we can only implement reentrancy for IO, not for general effect types, since reentrancy requires some form of fiber identity (which we can access using IOLocal).

@kevchuang
Copy link

Hi, I would like to help on this issue !

@kevchuang kevchuang linked a pull request Apr 17, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

4 participants