mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-06 01:19:38 +00:00
24 lines
577 B
C
24 lines
577 B
C
|
#include <stdio.h>
|
||
|
#include "cothreads.h"
|
||
|
|
||
|
// cothread_context is passed in argv
|
||
|
int loopfunc(int argc,char **argv) {
|
||
|
fprintf(stderr,"SIMPLE: in loopfunc\n");
|
||
|
cothread_switch((cothread_context *)cothread_main(argv));
|
||
|
}
|
||
|
|
||
|
int main(int argc,char *argv[]) {
|
||
|
cothread_context *ctx;
|
||
|
cothread_state *state;
|
||
|
|
||
|
ctx = cothread_init();
|
||
|
state = cothread_create(ctx);
|
||
|
cothread_setfunc(state,loopfunc,0,(char **)ctx);
|
||
|
|
||
|
fprintf(stderr,"SIMPLE: about to switch to cothread 1\n");
|
||
|
cothread_switch(state);
|
||
|
fprintf(stderr,"SIMPLE: back from cothread_switch\n");
|
||
|
|
||
|
return 0;
|
||
|
}
|