Skip to content

Commit abbd0c9

Browse files
committed
Document atomic-(inc|dec)-fetch, aka ++βš› and --βš›
1 parent bce40f1 commit abbd0c9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

β€Ždoc/Type/atomicint.pod6β€Ž

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,24 @@ too big to unbox to a 64-bit integer, an exception will be thrown. If C<$value>
137137
otherwise overflows C<atomicint> then it will be silently truncated before the
138138
subtraction is performed.
139139
140+
=head2 sub atomic-inc-fetch
141+
142+
multi sub atomic-inc--fetch(atomicint $ is rw)
143+
144+
Performs an atomic increment on a native integer. This will be performed using
145+
hardware-provided atomic operations. Since the operation is atomic, it is safe
146+
to use without acquiring a lock. Returns the value resulting from the
147+
increment. Overflow will wrap around silently.
148+
149+
=head2 sub atomic-dec-fetch
150+
151+
multi sub atomic-dec--fetch(atomicint $ is rw)
152+
153+
Performs an atomic decrement on a native integer. This will be performed using
154+
hardware-provided atomic operations. Since the operation is atomic, it is safe
155+
to use without acquiring a lock. Returns the value resulting from the
156+
decrement. Overflow will wrap around silently.
157+
140158
=head2 sub cas
141159
142160
Defined as:

0 commit comments

Comments
Β (0)