… | |
… | |
3488 | MODULE = Coro::State PACKAGE = Coro::Semaphore |
3488 | MODULE = Coro::State PACKAGE = Coro::Semaphore |
3489 | |
3489 | |
3490 | SV * |
3490 | SV * |
3491 | new (SV *klass, SV *count = 0) |
3491 | new (SV *klass, SV *count = 0) |
3492 | CODE: |
3492 | CODE: |
|
|
3493 | { |
|
|
3494 | int semcnt = 1; |
|
|
3495 | |
|
|
3496 | if (count) |
|
|
3497 | { |
|
|
3498 | SvGETMAGIC (count); |
|
|
3499 | |
|
|
3500 | if (SvOK (count)) |
|
|
3501 | semcnt = SvIV (count); |
|
|
3502 | } |
|
|
3503 | |
3493 | RETVAL = sv_bless ( |
3504 | RETVAL = sv_bless ( |
3494 | coro_waitarray_new (aTHX_ count && SvOK (count) ? SvIV (count) : 1), |
3505 | coro_waitarray_new (aTHX_ semcnt), |
3495 | GvSTASH (CvGV (cv)) |
3506 | GvSTASH (CvGV (cv)) |
3496 | ); |
3507 | ); |
|
|
3508 | } |
3497 | OUTPUT: |
3509 | OUTPUT: |
3498 | RETVAL |
3510 | RETVAL |
3499 | |
3511 | |
3500 | # helper for Coro::Channel and others |
3512 | # helper for Coro::Channel and others |
3501 | SV * |
3513 | SV * |