Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

What is the return value of lock()?

2 views
Skip to first unread message

Michael G Schwern

unread,
Aug 28, 2002, 9:05:25 AM8/28/02
to perl5-...@perl.org
Neither threads::shared nor perlfunc document what lock() is supposed to
return. It currently returns a reference to the locked value, like share()
does. Is this to be documented?

Additionally, why is the documentation for the lock() keyword split between
perlfunc and threads::shared?


--

Michael G. Schwern <sch...@pobox.com> http://www.pobox.com/~schwern/
Perl Quality Assurance <per...@perl.org> Kwalitee Is Job One
Me? A robot? That's rediculous! For one thing, that doesn't compute at all!

Elizabeth Mattijsen

unread,
Aug 28, 2002, 9:44:16 AM8/28/02
to Michael G Schwern, perl5-...@perl.org
At 06:05 AM 8/28/02 -0700, Michael G Schwern wrote:
>Additionally, why is the documentation for the lock() keyword split between
>perlfunc and threads::shared?

Because lock() is a built-in?


Liz

Michael G Schwern

unread,
Aug 28, 2002, 6:31:13 PM8/28/02
to Elizabeth Mattijsen, perl5-...@perl.org

That would explain why it's in perlfunc, but not why it's in threads::shared
or why one set of docs doesn't reference the other.

If it's a built-in, the docs should be in perlfunc. threads::shared should
simply reference perlfunc.


--

Michael G. Schwern <sch...@pobox.com> http://www.pobox.com/~schwern/
Perl Quality Assurance <per...@perl.org> Kwalitee Is Job One

Fuck with me and I will saw off your legs.
http://www.unamerican.com/

Dave Mitchell

unread,
Aug 28, 2002, 7:01:50 PM8/28/02
to Michael G Schwern, Elizabeth Mattijsen, perl5-...@perl.org
On Wed, Aug 28, 2002 at 03:31:13PM -0700, Michael G Schwern wrote:
> On Wed, Aug 28, 2002 at 03:44:16PM +0200, Elizabeth Mattijsen wrote:
> > At 06:05 AM 8/28/02 -0700, Michael G Schwern wrote:
> > >Additionally, why is the documentation for the lock() keyword split between
> > >perlfunc and threads::shared?
> >
> > Because lock() is a built-in?
>
> That would explain why it's in perlfunc, but not why it's in threads::shared
> or why one set of docs doesn't reference the other.
>
> If it's a built-in, the docs should be in perlfunc. threads::shared should
> simply reference perlfunc.

Becuase it's a built-in with no function (other than to provide a hook).
'use threads::shared' uses the hook to make lock() do something specific
to threads; in principle some other 'use' could make lock behave
differently. As to where this should be documented is anyone's guess.

Dave.

--
"Strange women lying in ponds distributing swords is no basis for a system
of government. Supreme executive power derives from a mandate from the
masses, not from some farcical aquatic ceremony."
Dennis - Monty Python and the Holy Grail.

0 new messages