Since this is a 'test & set', and a typical location for a race condition, am I correct in assuming that this needs to be locked? during the test&set, like:$PageQueue ||= Queue->new;
Thanks!{ lock $PageQueue; $PageQueue ||= Queue->new; }
In reply to is ||= threadsafe? by perl-diddler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |