use Thread::Synchronize; # activate :synchronize attribute
sub foo : synchronize { } # only one subroutine running at a time
Actually, this implementation uses a source filter, so no actual attribute handling is involved during runtime.
Liz
Update:
Changed the name of the module to Thread::Synchronized.
In reply to Thread::Synchronize
by liz
in thread (ithreads) :locked subs
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |