It appears identical. I am not sure why I thought it is better. Sorry about it...
Steve Lihn -----Original Message----- From: Michael G Schwern via RT [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 05, 2005 1:29 AM To: Lihn, Steve Subject: [perl #19088] Thread::Queue > [EMAIL PROTECTED] - Thu Dec 12 14:55:24 2002]: > I am looking at the Thread::Queue code. > The original is like: > > sub dequeue { > my $q = shift; > lock(@$q); > cond_wait @$q until @$q; > cond_signal @$q if @$q > 1; > return shift @$q; > } > > Should it be safer if it goes like this? > > sub dequeue { > my $q = shift; > lock(@$q); > cond_wait @$q until @$q; > my $p = shift @$q; > cond_signal @$q if @$q >= 1; > return $p; > } Why would this be safer? ------------------------------------------------------------------------------ Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as Banyu) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. ------------------------------------------------------------------------------