X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=ext%2Fthreads%2Fshared%2Fshared.pm;h=1f2ad9d99cdb8af2c91a7c1739269b813d2cb9b2;hb=5d19da2d0917eaf265a61e9e81cda3c17eee9cb0;hp=10d2af9df8ba8f8dcee1433b0172fe561210eae2;hpb=cd8c9bf8e75f7ca1681db747e53988762aec8fa2;p=p5sagit%2Fp5-mst-13.2.git diff --git a/ext/threads/shared/shared.pm b/ext/threads/shared/shared.pm index 10d2af9..1f2ad9d 100644 --- a/ext/threads/shared/shared.pm +++ b/ext/threads/shared/shared.pm @@ -17,7 +17,7 @@ BEGIN { *share = \&share_disabled; *cond_wait = \&cond_wait_disabled; *cond_signal = \&cond_signal_disabled; - *cond_broadcast = \&cond_broadcast_dosabled; + *cond_broadcast = \&cond_broadcast_disabled; *unlock = \&unlock_disabled; } } @@ -100,6 +100,9 @@ sub TIEHASH { } package threads::shared; + +$threads::shared::threads_shared = 1; + bootstrap threads::shared $VERSION; __END__ @@ -141,7 +144,7 @@ C, C, C, C, C, C =item share VARIABLE -C takes a value and marks it as shared, you can share an scalar, array, hash +C takes a value and marks it as shared, you can share a scalar, array, hash scalar ref, array ref and hash ref, C will return the shared value. C will traverse up references exactly I level. @@ -205,6 +208,14 @@ The C function works similarly to C. C, though, will unblock B the threads that are blocked in a C on the locked variable, rather than only one. + +=head1 NOTES + +threads::shared is designed is disable itself silently if threads are +not available. If you want access to threads, you must C +before you C. threads will emit a warning if you +use it before threads::shared. + =head1 BUGS C is not supported on shared references, in the current version