mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 18:21:04 +00:00
this works, but it sucks
Original commit message from CVS: this works, but it sucks
This commit is contained in:
parent
d9dfbdb8ef
commit
f8b0a4dc3a
1 changed files with 2 additions and 7 deletions
|
@ -21,19 +21,14 @@ void cothread (void *unused)
|
||||||
void pthread (void* unused)
|
void pthread (void* unused)
|
||||||
{
|
{
|
||||||
pth_mctx_t ctx;
|
pth_mctx_t ctx;
|
||||||
char *skaddr, *stackspace;
|
char *skaddr;
|
||||||
|
|
||||||
printf ("1: saving the main context\n");
|
printf ("1: saving the main context\n");
|
||||||
printf ("1: current stack frame: %p\n", CURRENT_STACK_FRAME);
|
printf ("1: current stack frame: %p\n", CURRENT_STACK_FRAME);
|
||||||
pth_mctx_save (&main_context);
|
pth_mctx_save (&main_context);
|
||||||
|
|
||||||
printf ("1: %d\n", pthread_self());
|
|
||||||
|
|
||||||
stackspace = malloc(2 * 1024 * 1024);
|
|
||||||
memset (stackspace + 2 * 1024 * 1024 - sizeof(pthread_descr) - 1, &(thread_handle (pthread_self()))->h_descr, sizeof (pthread_descr));
|
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
skaddr = stackspace;
|
skaddr = alloca (64 * 1024);
|
||||||
|
|
||||||
printf ("1: current stack frame: %p\n", CURRENT_STACK_FRAME);
|
printf ("1: current stack frame: %p\n", CURRENT_STACK_FRAME);
|
||||||
printf ("1: spawning a new cothread\n");
|
printf ("1: spawning a new cothread\n");
|
||||||
|
|
Loading…
Reference in a new issue