cats-effect
cats-effect copied to clipboard
Add `Lock` to std
trafficstars
Spinning out of https://github.com/typelevel/cats-effect/pull/3480#discussion_r1125597170.
The API would look something like:
abstract class Lock[F[_]] {
def shared: Resource[F, Unit]
def exclusive: Resource[F, Unit]
}
https://github.com/davenverse/lock - Available as some prior art.
…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).
Hi, I would like to help on this issue !