ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/Coro/Storable.pm
(Generate patch)

Comparing Coro/Coro/Storable.pm (file contents):
Revision 1.11 by root, Fri Apr 25 04:28:50 2008 UTC vs.
Revision 1.17 by root, Sat May 31 12:10:55 2008 UTC

68=cut 68=cut
69 69
70package Coro::Storable; 70package Coro::Storable;
71 71
72use strict; 72use strict;
73no warnings;
73 74
74use Coro (); 75use Coro ();
75use Coro::Semaphore (); 76use Coro::Semaphore ();
76 77
78BEGIN {
79 # suppress warnings
80 local $^W = 0;
81 require Storable;
82}
83
77use Storable; 84use Storable;
78use base "Exporter"; 85use base "Exporter";
79 86
80our $VERSION = 4.6; 87our $VERSION = 4.742;
81our @EXPORT = qw(thaw freeze nfreeze blocking_thaw blocking_freeze blocking_nfreeze); 88our @EXPORT = qw(thaw freeze nfreeze blocking_thaw blocking_freeze blocking_nfreeze);
82 89
83my $lock = new Coro::Semaphore; 90my $lock = new Coro::Semaphore;
84 91
85sub guard { 92sub guard {
157} 164}
158 165
159sub FILL { 166sub FILL {
160 if ($next_cede <= time) { 167 if ($next_cede <= time) {
161 $next_cede = time + $GRANULARITY; # calling time() twice usually is a net win 168 $next_cede = time + $GRANULARITY; # calling time() twice usually is a net win
162 Coro::cede; 169 Coro::cede ();
163 } 170 }
164 171
165 read $_[1], my $buf, 512 172 read $_[1], my $buf, 512
166 or return undef; 173 or return undef;
167 174

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines