Skip to content
This repository has been archived by the owner on Jul 7, 2024. It is now read-only.

Commit

Permalink
Add resetindex utility for resetting index counter
Browse files Browse the repository at this point in the history
  • Loading branch information
mofeing committed Apr 17, 2024
1 parent 0838c5a commit c1eab27
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ const __indexcounter::Threads.Atomic{Int} = Threads.Atomic{Int}(1)

currindex() = Tenet.letter(__indexcounter[])
nextindex() = Tenet.letter(Threads.atomic_add!(__indexcounter, 1))
resetindex() = Tenet.letter(Threads.atomic_xchg!(__indexcounter, 1))

0 comments on commit c1eab27

Please sign in to comment.