Closed schweikert closed 9 years ago
Thanks, I applied a version of this change from the command line.
Note that it didn't work without the '&' for me under certain conditions. That's why I modified it as follows: https://github.com/open-ch/Log-Dispatch/commit/7f2c7a3728781c81455bd10b02f0cbeff41a453e I can try to reproduce the issue...
I can reproduce the issue.
#!/usr/bin/perl -w
use Log::Dispatch;
use threads;
use threads::shared;
my $log = Log::Dispatch->new(
outputs => [
[
'Syslog',
min_level => 'info',
ident => 'Yadda yadda'
]
],
lock => 1,
);
$log->emerg("Time to die.");
$ ./test-lock.pl Type of arg 1 to threads::shared::share must be one of [$@%](not single ref constructor) at /opt/OSAGperlm/lib/Log/Dispatch/Syslog.pm line 67, near "$thread_lock)" Compilation failed in require at /opt/OSAGperlm/lib/Module/Runtime.pm line 317.
If I add the '&', it works.
I did write a test for this - https://github.com/houseabsolute/Log-Dispatch/blob/master/t/06-syslog.t
It passed on Travis - https://travis-ci.org/houseabsolute/Log-Dispatch/builds/74317771
It'd be great to reproduce this in a test somehow.
Aha, I was able to reproduce it
Without this patch I get: