Mutex: Difference between revisions

m (→‎{{header|Logtalk}}: Add note on dependency)
Line 662:
}</lang>
 
=={{header|Perl 6}}==
<lang perl6>my $lock = Lock.new;
 
$lock.protect: { your-ad-here() }</lang>
Locks are reentrant. You may explicitly lock and unlock them, but the syntax above guarantees the lock will be unlocked on scope exit, even if by thrown exception or other exotic control flow. That being said, direct use of locks is discouraged in Perl 6 in favor of promises, channels, and supplies, which offer better composable semantics.
=={{header|PicoLisp}}==
PicoLisp uses several mechanisms of interprocess communication, mainly within
Anonymous user