develooper Front page | perl.perl5.porters | Postings from February 2008

Thread::Semaphore issues

From:
Jerry D. Hedden
Date:
February 13, 2008 11:54
Subject:
Thread::Semaphore issues
Message ID:
1ff86f510802131154h69b3452dsce5a9eb001a4a035@mail.gmail.com
While working on a patch to update the Thread::Semaphore
docs (it uses 'new Thread::Semaphore' for instance), I
noticed that its methods validate their arguments.

Obviously, calling any of its methods with a non-numeric
argument is an error, but what of the following:

    $s->down(0);
    $s->down(0.5);
    $s->down(-1);

    $s->up(0);
    $s->up(0.5);
    $s->up(-1);

Since the no-arg defaults are 1, and the usually expected
values are positive integers, I would classify the above as
errors.  Comments?



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About