--- AnyEvent/lib/AnyEvent.pm 2011/01/14 06:32:21 1.346 +++ AnyEvent/lib/AnyEvent.pm 2011/08/02 20:02:44 1.350 @@ -880,6 +880,7 @@ AnyEvent::Impl::Irssi used when running within irssi. AnyEvent::Impl::IOAsync based on IO::Async. AnyEvent::Impl::Cocoa based on Cocoa::EventLoop. + AnyEvent::Impl::FLTK based on FLTK. =item Backends with special needs. @@ -1163,7 +1164,7 @@ use Carp (); -our $VERSION = '5.3'; +our $VERSION = '5.34'; our $MODEL; our $AUTOLOAD; @@ -1213,10 +1214,11 @@ [Prima:: => AnyEvent::Impl::POE::], [IO::Async::Loop:: => AnyEvent::Impl::IOAsync::], [Cocoa::EventLoop:: => AnyEvent::Impl::Cocoa::], + [FLTK:: => AnyEvent::Impl::FLTK::], ); our %method = map +($_ => 1), - qw(io timer time now now_update signal child idle condvar one_event DESTROY); + qw(io timer time now now_update signal child idle condvar DESTROY); our @post_detect; @@ -1739,6 +1741,10 @@ # nop } +sub _wait { + Carp::croak "$AnyEvent::MODEL does not support blocking waits. Caught"; +} + sub send { my $cv = shift; $cv->{_ae_sent} = [@_]; @@ -1755,20 +1761,21 @@ $_[0]{_ae_sent} } -sub _wait { - $WAITING - and !$_[0]{_ae_sent} - and Carp::croak "AnyEvent::CondVar: recursive blocking wait detected"; +sub recv { + unless ($_[0]{_ae_sent}) { + $WAITING + and Carp::croak "AnyEvent::CondVar: recursive blocking wait detected"; - local $WAITING = 1; - AnyEvent->one_event while !$_[0]{_ae_sent}; -} + local $WAITING = 1; + $_[0]->_wait; + } -sub recv { - $_[0]->_wait; + $_[0]{_ae_croak} + and Carp::croak $_[0]{_ae_croak}; - Carp::croak $_[0]{_ae_croak} if $_[0]{_ae_croak}; - wantarray ? @{ $_[0]{_ae_sent} } : $_[0]{_ae_sent}[0] + wantarray + ? @{ $_[0]{_ae_sent} } + : $_[0]{_ae_sent}[0] } sub cb { @@ -1794,7 +1801,7 @@ # undocumented/compatibility with pre-3.4 *broadcast = \&send; -*wait = \&_wait; +*wait = \&recv; =head1 ERROR AND EXCEPTION HANDLING