Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dpdani committed Oct 29, 2024
1 parent 41c9b77 commit e20aeb2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/atomic_dict/partitioned_iter.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,6 @@ def iterator(i):
t.start()
for t in threads:
t.join()
print(f"Partitioned iter took {(time.time() - started) * 1000:.0f}ms with {n} threads ({partials=} {sum(partials)=}).")
print(
f"Partitioned iter took {(time.time() - started) * 1000:.0f}ms with {n} threads ({partials=} {sum(partials)=})."
)
2 changes: 2 additions & 0 deletions src/cereggii/_cereggii.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ class AtomicRef:
- if it is `expected`, then replace it with `desired` and return `True`
- else, don't change it and return `False`.
"""

def get(self) -> object:
"""
Atomically read the current value of this `AtomicRef`.
Expand All @@ -472,6 +473,7 @@ class AtomicRef:
Atomically swap the value of this `AtomicRef` to `desired` and return
the previously stored value.
"""

def set(self, desired: object): # noqa: A003
"""
Unconditionally set the value of this `AtomicRef` to `desired`.
Expand Down

0 comments on commit e20aeb2

Please sign in to comment.