Skip to content

Commit 41ef2c6

Browse files
jamessantonycoz
authored andcommitted
lib/perl5db.pl: Restore noop lock prototype
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]>
1 parent 902d169 commit 41ef2c6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/perl5db.pl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -871,6 +871,7 @@ BEGIN
871871
lock($DBGR);
872872
print "Threads support enabled\n";
873873
} else {
874+
*lock = sub(*) {};
874875
*share = sub(\[$@%]) {};
875876
}
876877
}

0 commit comments

Comments
 (0)