Skip Menu |

This queue is for tickets about the Mac-SleepEvent CPAN distribution.

Report information
The Basics
Id: 50317
Status: stalled
Priority: 0/
Queue: Mac-SleepEvent

People
Owner: Nobody in particular
Requestors: bitcard [...] smoky.tikasys.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: listen returns in thread.
Date: Wed, 07 Oct 2009 21:54:31 -0600
To: bug-Mac-SleepEvent [...] rt.cpan.org
From: TDH <bitcard [...] smoky.tikasys.com>
When I use Mac::SleepEvent in a multithreaded program if fails for reason I don't understand. Mac OS X 10.6.1 Mac::SleepEvent 0.02, Consider the following script, listen returns with $! set to "No such file or directory". Maybe I'm trying something that was not intended... #!/usr/bin/perl use strict; use threads; use Mac::SleepEvent; my $thr = threads->create(\&monitor_thread); $thr->detach(); sleep 120; sub monitor_thread { my $sn = Mac::SleepEvent->new( wake => sub {warn "waking\n"}, sleep => sub {warn "sleeping\n"}, logout => sub {warn "logging off\n"}, ); $sn->listen; warn "monitor thread died: $!\n"; exit(0); }
I get the same error. It looks like the error actually occurs in the 'new' sub, when trying to load the AppKit library. I don't think I will be able to get this to work with threading, but I will try to create an example that runs the monitor in a child process.