diff options
author | pcg <pcg> | 2004-04-01 03:11:15 +0000 |
---|---|---|
committer | pcg <pcg> | 2004-04-01 03:11:15 +0000 |
commit | ac592223bc7e1592620cfeaa0aad3331b6b012bf (patch) | |
tree | e75a7ff6cb4b9508aeb2759c121c0456cd875482 | |
parent | 3f48dba6c10a8a0bea15c9fa1246aadf2e9e6b44 (diff) |
*** empty log message ***rel-1_0
-rw-r--r-- | coro.h | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -30,7 +30,7 @@ * go to Ralf S. Engelschall <rse@engelschall.com>. * * This coroutine library is very much stripped down. You should either - * build your own process avstraction using it or - better - just use GNU + * build your own process abstraction using it or - better - just use GNU * Portable Threads, http://www.gnu.org/software/pth/. * * VERSION: 0.1 @@ -103,9 +103,9 @@ typedef struct coro_context coro_context; * Allocating/deallocating the stack is your own responsibility, so there is * no coro_destroy function. */ -void coro_create(coro_context *ctx, - coro_func coro, void *arg, - void *sptr, long ssize); +void coro_create (coro_context *ctx, + coro_func coro, void *arg, + void *sptr, long ssize); /* * The following prototype defines the coroutine switching function. It is @@ -145,7 +145,7 @@ struct coro_context { ucontext_t uc; }; -#define coro_transfer(p,n) swapcontext(&((p)->uc), &((n)->uc)) +#define coro_transfer(p,n) swapcontext (&((p)->uc), &((n)->uc)) #elif CORO_SJLJ || CORO_LOOSE || CORO_LINUX || CORO_IRIX @@ -155,7 +155,7 @@ struct coro_context { jmp_buf env; }; -#define coro_transfer(p,n) if (!setjmp ((p)->env)) longjmp ((n)->env, 1) +#define coro_transfer(p,n) do { if (!setjmp ((p)->env)) longjmp ((n)->env, 1); } while(0) #endif |