Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
survive threading
  • Loading branch information
dk committed Dec 17, 2016
1 parent 420b9cb commit 2d0aa0a
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/IO/Lambda/Loop/Prima.pm
Expand Up @@ -9,14 +9,25 @@ use Prima qw(Application);

IO::Lambda::Loop::default('Prima');

use vars qw(%filenos @timers $timer $deadline $event @mask $DEBUG);
use vars qw(%filenos @timers $timer $deadline $event @mask @prima_events $DEBUG);

# $DEBUG = 1;

$mask[IO_READ] = fe::Read;
$mask[IO_WRITE] = fe::Write;
$mask[IO_EXCEPTION] = fe::Exception;

sub CLONE
{
undef %filenos;
undef @timers;
undef $timer;
undef $deadline;
undef $event;
undef @mask;
undef @prima_events;
}

sub new { bless {} , shift }

sub reset_mask
Expand All @@ -39,7 +50,6 @@ sub reset_mask
}
}

my @prima_events;
sub io_filter { push @prima_events, \@_; return 0 }
sub on_read { on_io($_[0], fe::Read) }
sub on_write { on_io($_[0], fe::Write) }
Expand Down

0 comments on commit 2d0aa0a

Please sign in to comment.