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

Comparing Coro/Coro.pm (file contents):
Revision 1.81 by root, Fri Nov 24 11:36:57 2006 UTC vs.
Revision 1.82 by root, Fri Nov 24 13:40:36 2006 UTC

141 141
142 # the next line destroys the _coro_state, but keeps the 142 # the next line destroys the _coro_state, but keeps the
143 # process itself intact (we basically make it a zombie 143 # process itself intact (we basically make it a zombie
144 # process that always runs the manager thread, so it's possible 144 # process that always runs the manager thread, so it's possible
145 # to transfer() to this process). 145 # to transfer() to this process).
146 $coro->{_coro_state} = $manager->{_coro_state}; 146 $coro->{_coro_state}->_clone_state_from ($manager->{_coro_state});
147 } 147 }
148 &schedule; 148 &schedule;
149 } 149 }
150}; 150};
151 151
274 &schedule; 274 &schedule;
275 } 275 }
276 wantarray ? @{$self->{status}} : $self->{status}[0]; 276 wantarray ? @{$self->{status}} : $self->{status}[0];
277} 277}
278 278
279=item $oldprio = $process->prio($newprio) 279=item $oldprio = $process->prio ($newprio)
280 280
281Sets (or gets, if the argument is missing) the priority of the 281Sets (or gets, if the argument is missing) the priority of the
282process. Higher priority processes get run before lower priority 282process. Higher priority processes get run before lower priority
283processes. Priorities are small signed integers (currently -4 .. +3), 283processes. Priorities are small signed integers (currently -4 .. +3),
284that you can refer to using PRIO_xxx constants (use the import tag :prio 284that you can refer to using PRIO_xxx constants (use the import tag :prio
299process). This is a bug that will be fixed in some future version. 299process). This is a bug that will be fixed in some future version.
300 300
301=cut 301=cut
302 302
303sub prio { 303sub prio {
304 my $old = $_[0]{prio}; 304 shift->{_coro_state}->prio (@_)
305 $_[0]{prio} = $_[1] if @_ > 1;
306 $old;
307} 305}
308 306
309=item $newprio = $process->nice($change) 307=item $newprio = $process->nice ($change)
310 308
311Similar to C<prio>, but subtract the given value from the priority (i.e. 309Similar to C<prio>, but subtract the given value from the priority (i.e.
312higher values mean lower priority, just as in unix). 310higher values mean lower priority, just as in unix).
313 311
314=cut 312=cut
315 313
316sub nice { 314sub nice {
317 $_[0]{prio} -= $_[1]; 315 shift->{_coro_state}->nice (@_)
318} 316}
319 317
320=item $olddesc = $process->desc($newdesc) 318=item $olddesc = $process->desc ($newdesc)
321 319
322Sets (or gets in case the argument is missing) the description for this 320Sets (or gets in case the argument is missing) the description for this
323process. This is just a free-form string you can associate with a process. 321process. This is just a free-form string you can associate with a process.
324 322
325=cut 323=cut

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines