… | |
… | |
402 | args.arg = arg; |
402 | args.arg = arg; |
403 | args.self = ctx; |
403 | args.self = ctx; |
404 | args.main = &nctx; |
404 | args.main = &nctx; |
405 | |
405 | |
406 | pthread_attr_init (&attr); |
406 | pthread_attr_init (&attr); |
|
|
407 | #if __UCLIBC__ |
|
|
408 | pthread_attr_setstacksize (&attr, (size_t)ssize); |
|
|
409 | #else |
407 | pthread_attr_setstack (&attr, sptr, (size_t)ssize); |
410 | pthread_attr_setstack (&attr, sptr, (size_t)ssize); |
|
|
411 | #endif |
408 | pthread_attr_setscope (&attr, PTHREAD_SCOPE_PROCESS); |
412 | pthread_attr_setscope (&attr, PTHREAD_SCOPE_PROCESS); |
409 | pthread_create (&ctx->id, &attr, coro_init, &args); |
413 | pthread_create (&ctx->id, &attr, coro_init, &args); |
410 | |
414 | |
411 | coro_transfer (args.main, args.self); |
415 | coro_transfer (args.main, args.self); |
412 | } |
416 | } |