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

Comparing Coro/Coro/State.xs (file contents):
Revision 1.278 by root, Sun Nov 16 07:09:28 2008 UTC vs.
Revision 1.279 by root, Sun Nov 16 08:59:16 2008 UTC

1830{ 1830{
1831 prepare_set_stacklevel (ta, (struct coro_cctx *)slf_frame.data); 1831 prepare_set_stacklevel (ta, (struct coro_cctx *)slf_frame.data);
1832} 1832}
1833 1833
1834static void 1834static void
1835slf_init_set_stacklevel (pTHX_ struct CoroSLF *frame, SV **arg, int items) 1835slf_init_set_stacklevel (pTHX_ struct CoroSLF *frame, CV *cv, SV **arg, int items)
1836{ 1836{
1837 assert (("FATAL: set_stacklevel needs the coro cctx as sole argument", items == 1)); 1837 assert (("FATAL: set_stacklevel needs the coro cctx as sole argument", items == 1));
1838 1838
1839 frame->prepare = slf_prepare_set_stacklevel; 1839 frame->prepare = slf_prepare_set_stacklevel;
1840 frame->check = slf_check_nop; 1840 frame->check = slf_check_nop;
1848 1848
1849 prepare_transfer (aTHX_ ta, arg [0], arg [1]); 1849 prepare_transfer (aTHX_ ta, arg [0], arg [1]);
1850} 1850}
1851 1851
1852static void 1852static void
1853slf_init_transfer (pTHX_ struct CoroSLF *frame, SV **arg, int items) 1853slf_init_transfer (pTHX_ struct CoroSLF *frame, CV *cv, SV **arg, int items)
1854{ 1854{
1855 if (items != 2) 1855 if (items != 2)
1856 croak ("Coro::State::transfer (prev, next) expects two arguments, not %d,", items); 1856 croak ("Coro::State::transfer (prev, next) expects two arguments, not %d,", items);
1857 1857
1858 frame->prepare = slf_prepare_transfer; 1858 frame->prepare = slf_prepare_transfer;
1859 frame->check = slf_check_nop; 1859 frame->check = slf_check_nop;
1860 frame->data = (void *)arg; /* let's hope it will stay valid */ 1860 frame->data = (void *)arg; /* let's hope it will stay valid */
1861} 1861}
1862 1862
1863static void 1863static void
1864slf_init_schedule (pTHX_ struct CoroSLF *frame, SV **arg, int items) 1864slf_init_schedule (pTHX_ struct CoroSLF *frame, CV *cv, SV **arg, int items)
1865{ 1865{
1866 frame->prepare = prepare_schedule; 1866 frame->prepare = prepare_schedule;
1867 frame->check = slf_check_nop; 1867 frame->check = slf_check_nop;
1868} 1868}
1869 1869
1870static void 1870static void
1871slf_init_cede (pTHX_ struct CoroSLF *frame, SV **arg, int items) 1871slf_init_cede (pTHX_ struct CoroSLF *frame, CV *cv, SV **arg, int items)
1872{ 1872{
1873 frame->prepare = prepare_cede; 1873 frame->prepare = prepare_cede;
1874 frame->check = slf_check_nop; 1874 frame->check = slf_check_nop;
1875} 1875}
1876 1876
1877static void 1877static void
1878slf_init_cede_notself (pTHX_ struct CoroSLF *frame, SV **arg, int items) 1878slf_init_cede_notself (pTHX_ struct CoroSLF *frame, CV *cv, SV **arg, int items)
1879{ 1879{
1880 frame->prepare = prepare_cede_notself; 1880 frame->prepare = prepare_cede_notself;
1881 frame->check = slf_check_nop; 1881 frame->check = slf_check_nop;
1882} 1882}
1883 1883
1922 items = AvFILLp (av) + 1; 1922 items = AvFILLp (av) + 1;
1923 } 1923 }
1924 1924
1925 PUTBACK; 1925 PUTBACK;
1926 1926
1927 ((coro_slf_cb)CvXSUBANY (GvCV (gv)).any_ptr) (aTHX_ &slf_frame, arg, items); 1927 ((coro_slf_cb)CvXSUBANY (GvCV (gv)).any_ptr) (aTHX_ &slf_frame, GvCV (gv), arg, items);
1928 } 1928 }
1929 1929
1930 /* now interpret the slf_frame */ 1930 /* now interpret the slf_frame */
1931 /* we use a callback system not to make the code needlessly */ 1931 /* we use a callback system not to make the code needlessly */
1932 /* complicated, but so we can run multiple perl coros from one cctx */ 1932 /* complicated, but so we can run multiple perl coros from one cctx */
2025 return 1; 2025 return 1;
2026 } 2026 }
2027} 2027}
2028 2028
2029static void 2029static void
2030slf_init_semaphore_down (pTHX_ struct CoroSLF *frame, SV **arg, int items) 2030slf_init_semaphore_down (pTHX_ struct CoroSLF *frame, CV *cv, SV **arg, int items)
2031{ 2031{
2032 AV *av = (AV *)SvRV (arg [0]); 2032 AV *av = (AV *)SvRV (arg [0]);
2033 2033
2034 if (SvIVX (AvARRAY (av)[0]) > 0) 2034 if (SvIVX (AvARRAY (av)[0]) > 0)
2035 { 2035 {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines