diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-11-01 06:18:16 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-11-01 12:41:01 -0700 |
commit | fd013656aac5ea6c6848b28fb99b749c386c5d7e (patch) | |
tree | 675f9d6c27a8ef123c9e79fa432031c7800d1155 /dist/threads-shared | |
parent | 307ed07106218f2ff26c0138504fc3da02cd262f (diff) | |
download | perl-fd013656aac5ea6c6848b28fb99b749c386c5d7e.tar.gz |
Move threads::shared warnings from perldiag to shared.pm
following the precedent set by threads.pm.
Diffstat (limited to 'dist/threads-shared')
-rw-r--r-- | dist/threads-shared/lib/threads/shared.pm | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/dist/threads-shared/lib/threads/shared.pm b/dist/threads-shared/lib/threads/shared.pm index e5c3669c07..1a03270264 100644 --- a/dist/threads-shared/lib/threads/shared.pm +++ b/dist/threads-shared/lib/threads/shared.pm @@ -521,6 +521,38 @@ If you want access to threads, you must C<use threads> before you C<use threads::shared>. L<threads> will emit a warning if you use it after L<threads::shared>. +=head1 WARNINGS + +=over 4 + +=item cond_broadcast() called on unlocked variable + +Within a thread-enabled program, you tried to call cond_broadcast() on a +variable which wasn't locked. The cond_broadcast() function is used to +wake up another thread that is waiting in a cond_wait(). To ensure that +the signal isn't sent before the other thread has a chance to enter the +wait, it is usual for the signaling thread first to wait for a lock on +variable. This lock attempt will only succeed after the other thread has +entered cond_wait() and thus relinquished the lock. + +=item cond_signal() called on unlocked variable + +Within a thread-enabled program, you tried to call cond_signal() on a +variable which wasn't locked. The cond_signal() function is used to wake +up another thread that is waiting in a cond_wait(). To ensure that the +signal isn't sent before the other thread has a chance to enter the wait, +it is usual for the signaling thread first to wait for a lock on variable. +This lock attempt will only succeed after the other thread has entered +cond_wait() and thus relinquished the lock. + +=back + +If needed, thread warnings can be suppressed by using: + + no warnings 'threads'; + +in the appropriate scope. + =head1 BUGS AND LIMITATIONS When C<share> is used on arrays, hashes, array refs or hash refs, any data |