File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -828,6 +828,20 @@ C<protect> returns whatever the code block returns.
828828Because C<protect> will block any threads that are waiting to execute
829829the critical section the code should be as quick as possible.
830830
831+ =head2 Lock::Async
832+
833+ L<C<Lock::Async>|/type/Lock::Async> is a mutual exclusion mechanism much like
834+ Lock, but it exposes its functionality through C<Promise>s, allowing the use of
835+ C<await> when waiting for a lock to become available, instead of blocking an
836+ entire thread.
837+
838+ Another difference is that it is not re-entrant, meaning that the lock is not
839+ considered available to code that is C<protect>ed by the lock.
840+
841+ C<Lock::Async> is more high-level than C<Lock>, but it is still considered a
842+ low-level primitive. Higher-level primitives should be preferred over mutating
843+ shared data inside critical sections.
844+
831845=head1 Safety concerns
832846
833847Some shared data concurrency issues are less obvious than others.
You can’t perform that action at this time.
0 commit comments