--- cvsroot/Coro/Coro.pm 2010/12/26 16:23:51 1.282 +++ cvsroot/Coro/Coro.pm 2011/02/05 21:20:47 1.283 @@ -759,6 +759,20 @@ =cut +for my $module (qw(Channel RWLock Semaphore SemaphoreSet Signal Specific)) { + my $old = defined &{"Coro::$module\::new"} && \&{"Coro::$module\::new"}; + + *{"Coro::$module\::new"} = sub { + require "Coro/$module.pm"; + + # some modules have their new predefined in State.xs, some don't + *{"Coro::$module\::new"} = $old + if $old; + + goto &{"Coro::$module\::new"}; + }; +} + 1; =head1 HOW TO WAIT FOR A CALLBACK