Skip to content

Commit

Permalink
lib/perl5db.pl: Restore noop lock prototype
Browse files Browse the repository at this point in the history
cde405a removed the lock prototype
"because it's already a do-nothing weak keyword without threads".
However, that causes "perl -d threaded-script.pl" to complain

    lock can only be used on shared values at /usr/share/perl/5.20/perl5db.pl line 4101.
    BEGIN failed--compilation aborted at threaded-script.pl line 2.
    lock can only be used on shared values at /usr/share/perl/5.20/perl5db.pl line 2514.
    END failed--call queue aborted at threaded-script.pl line 2.
    Unbalanced scopes: 3 more ENTERs than LEAVEs

because threaded-script.pl's importing of threads::shared enable's
lock()'s non-noop behavior.  Restoring the lock() prototype fixes the
inconsistency between lock() and share() usage.

Signed-off-by: James McCoy <[email protected]>
  • Loading branch information
jamessan authored and tonycoz committed Apr 15, 2015
1 parent 902d169 commit 41ef2c6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/perl5db.pl
Original file line number Diff line number Diff line change
Expand Up @@ -871,6 +871,7 @@ BEGIN
lock($DBGR);
print "Threads support enabled\n";
} else {
*lock = sub(*) {};
*share = sub(\[$@%]) {};
}
}
Expand Down

0 comments on commit 41ef2c6

Please sign in to comment.