Skip to content

Commit

Permalink
Updating CHANGELOG_NEXT.md with new function name, atomically, and up…
Browse files Browse the repository at this point in the history
…dating tests/chez/chez003/IORef.idr to reflect new function.
  • Loading branch information
Matthew-Mosior committed Sep 7, 2024
1 parent 94c5302 commit 0501bcb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG_NEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ This CHANGELOG describes the merged but unreleased changes. Please see [CHANGELO

* Added implementations of `Foldable` and `Traversable` for `Control.Monad.Identity`

* Added `Data.IORef.atomicModifyIORef` for the chez backend.
* Added `Data.IORef.atomically` for the chez backend.

#### Contrib

Expand Down
4 changes: 2 additions & 2 deletions tests/chez/chez003/IORef.idr
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ parameters (ref : IORef Nat)

runFastInc : Nat -> IO ()
runFastInc 0 = pure ()
runFastInc (S k) = atomicModifyIORef lock ref S >> runFastInc k
runFastInc (S k) = atomically lock (modifyIORef ref S) >> runFastInc k

runSlowInc : Nat -> IO ()
runSlowInc 0 = pure ()
runSlowInc (S k) = atomicModifyIORef lock ref (slowinc 10000) >> runSlowInc k
runSlowInc (S k) = atomically lock (modifyIORef ref (slowinc 10000)) >> runSlowInc k

main : IO ()
main
Expand Down

0 comments on commit 0501bcb

Please sign in to comment.