… | |
… | |
573 | Allocate $time seconds of blocking CPU time at priority C<$priority> |
573 | Allocate $time seconds of blocking CPU time at priority C<$priority> |
574 | (default: 0): This call blocks and returns only when you have at least |
574 | (default: 0): This call blocks and returns only when you have at least |
575 | C<$time> seconds of cpu time till the next tick. The slot is only valid |
575 | C<$time> seconds of cpu time till the next tick. The slot is only valid |
576 | till the next cede. |
576 | till the next cede. |
577 | |
577 | |
578 | Background jobs should use a priority les than zero, interactive jobs |
578 | Background jobs should use a priority less than zero, interactive jobs |
579 | should use 100 or more. |
579 | should use 100 or more. |
580 | |
580 | |
581 | The optional C<$name> can be used to identify the job to run. It might be |
581 | The optional C<$name> can be used to identify the job to run. It might be |
582 | used for statistical purposes and should identify the same time-class. |
582 | used for statistical purposes and should identify the same time-class. |
583 | |
583 | |
… | |
… | |
738 | reset_signals; |
738 | reset_signals; |
739 | } |
739 | } |
740 | |
740 | |
741 | sub fork_call(&@) { |
741 | sub fork_call(&@) { |
742 | my ($cb, @args) = @_; |
742 | my ($cb, @args) = @_; |
743 | |
|
|
744 | # we seemingly have to make a local copy of the whole thing, |
|
|
745 | # otherwise perl prematurely frees the stuff :/ |
|
|
746 | # TODO: investigate and fix (likely this will be rather laborious) |
|
|
747 | |
743 | |
748 | my @res = Coro::Util::fork_eval { |
744 | my @res = Coro::Util::fork_eval { |
749 | cf::post_fork; |
745 | cf::post_fork; |
750 | &$cb |
746 | &$cb |
751 | } @args; |
747 | } @args; |