1 | #include "EXTERN.h" |
1 | #include "EXTERN.h" |
2 | #include "perl.h" |
2 | #include "perl.h" |
3 | #include "XSUB.h" |
3 | #include "XSUB.h" |
4 | |
4 | |
5 | #include "libcoro/coro.c" |
5 | #include "libcoro/coro.c" |
|
|
6 | |
|
|
7 | #include <signal.h> |
6 | |
8 | |
7 | #ifdef HAVE_MMAP |
9 | #ifdef HAVE_MMAP |
8 | # include <unistd.h> |
10 | # include <unistd.h> |
9 | # include <sys/mman.h> |
11 | # include <sys/mman.h> |
10 | # ifndef MAP_ANON |
12 | # ifndef MAP_ANON |
… | |
… | |
794 | Coro::State_or_hashref prev |
796 | Coro::State_or_hashref prev |
795 | Coro::State_or_hashref next |
797 | Coro::State_or_hashref next |
796 | int flags |
798 | int flags |
797 | PROTOTYPE: @ |
799 | PROTOTYPE: @ |
798 | CODE: |
800 | CODE: |
|
|
801 | PUTBACK; |
799 | transfer (aTHX_ prev, next, flags); |
802 | transfer (aTHX_ prev, next, flags); |
|
|
803 | SPAGAIN; |
800 | |
804 | |
801 | void |
805 | void |
802 | DESTROY(coro) |
806 | DESTROY(coro) |
803 | Coro::State coro |
807 | Coro::State coro |
804 | CODE: |
808 | CODE: |
… | |
… | |
824 | void |
828 | void |
825 | flush() |
829 | flush() |
826 | CODE: |
830 | CODE: |
827 | #ifdef MAY_FLUSH |
831 | #ifdef MAY_FLUSH |
828 | flush_padlist_cache (); |
832 | flush_padlist_cache (); |
|
|
833 | #endif |
|
|
834 | |
|
|
835 | void |
|
|
836 | _exit(code) |
|
|
837 | int code |
|
|
838 | PROTOTYPE: $ |
|
|
839 | CODE: |
|
|
840 | #if defined(__GLIBC__) || _POSIX_C_SOURCE |
|
|
841 | _exit (code); |
|
|
842 | #else |
|
|
843 | signal (SIGTERM, SIG_DFL); |
|
|
844 | raise (SIGTERM); |
|
|
845 | exit (code); |
829 | #endif |
846 | #endif |
830 | |
847 | |
831 | MODULE = Coro::State PACKAGE = Coro::Cont |
848 | MODULE = Coro::State PACKAGE = Coro::Cont |
832 | |
849 | |
833 | # this is slightly dirty |
850 | # this is slightly dirty |