Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/shared/src/main/scala/zio/FiberRef.scala
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ trait FiberRef[A] extends Serializable { self =>
* scope is closed.
*/
final def locallyScoped(value: A)(implicit trace: Trace): ZIO[Scope, Nothing, Unit] =
ZIO.acquireRelease(get.flatMap(old => set(value).as(old)))(set).unit
ZIO.acquireRelease(getAndSet(value))(set).unit

/**
* Returns a scoped workflow that updates the value associated with the
Expand Down
Loading