… | |
… | |
314 | # used by Coro::Debug only atm. |
314 | # used by Coro::Debug only atm. |
315 | sub debug_desc { |
315 | sub debug_desc { |
316 | $_[0]{desc} |
316 | $_[0]{desc} |
317 | } |
317 | } |
318 | |
318 | |
|
|
319 | # for very deep reasons, we must initialise $Coro::main here. |
|
|
320 | |
|
|
321 | { |
|
|
322 | package Coro; |
|
|
323 | |
|
|
324 | our $main; # main coroutine |
|
|
325 | our $current; # current coroutine |
|
|
326 | |
|
|
327 | $main = Coro::State::new Coro::; |
|
|
328 | |
|
|
329 | $main->{desc} = "[main::]"; |
|
|
330 | |
|
|
331 | # maybe some other module used Coro::Specific before... |
|
|
332 | $main->{_specific} = $current->{_specific} |
|
|
333 | if $current; |
|
|
334 | |
|
|
335 | _set_current $main; |
|
|
336 | } |
|
|
337 | |
319 | 1; |
338 | 1; |
320 | |
339 | |
321 | =back |
340 | =back |
322 | |
341 | |
323 | =head1 BUGS |
342 | =head1 BUGS |