perl不会找到Thread :: Semaphore的down_force方法吗?

时间:2011-12-14 22:21:42

标签: multithreading perl semaphore

我验证了该软件包是使用perldoc -l Thread :: Semaphore安装的,但我仍然收到此错误: Can't locate object method "down_force" via package "Thread::Semaphore" at <filename line#>

我的代码:

: #use perl
   eval 'exec perl -S $0 ${1+"$@"}'
   if 0;

use threads;
use threads::shared;
use Thread::Semaphore;

my $s = Thread::Semaphore->new();

$s->down_force();    #it complains about this one

#some code here...

1 个答案:

答案 0 :(得分:3)

您可能拥有version 2.09 of Thread::Semaphore,其中没有down_force()方法。尝试升级到most recent version,目前为2.12。