diff options
| author | rsc <devnull@localhost> | 2004-12-25 21:56:33 +0000 |
|---|---|---|
| committer | rsc <devnull@localhost> | 2004-12-25 21:56:33 +0000 |
| commit | 1544f90960275dc9211bde30329c3258e0e1bf38 (patch) | |
| tree | f55e7a73c03aaa24daa7cc2ad02822b921c477f9 /src/libthread/ucontext.c | |
| parent | 7788fd54094693384ef5c92c475656dba8819feb (diff) | |
| download | plan9port-1544f90960275dc9211bde30329c3258e0e1bf38.tar.gz plan9port-1544f90960275dc9211bde30329c3258e0e1bf38.zip | |
New thread library
Diffstat (limited to 'src/libthread/ucontext.c')
| -rw-r--r-- | src/libthread/ucontext.c | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/src/libthread/ucontext.c b/src/libthread/ucontext.c deleted file mode 100644 index 98e92ccf..00000000 --- a/src/libthread/ucontext.c +++ /dev/null @@ -1,49 +0,0 @@ -#include "threadimpl.h" - -static void -launcher(void (*f)(void*), void *arg) -{ - f(arg); - threadexits(nil); -} - -void -_threadinitstack(Thread *t, void (*f)(void*), void *arg) -{ - sigset_t zero; - - /* do a reasonable initialization */ - memset(&t->context.uc, 0, sizeof t->context.uc); - sigemptyset(&zero); - sigprocmask(SIG_BLOCK, &zero, &t->context.uc.uc_sigmask); - - /* call getcontext, because on Linux makecontext neglects floating point */ - getcontext(&t->context.uc); - - /* call makecontext to do the real work. */ - /* leave a few words open on both ends */ - t->context.uc.uc_stack.ss_sp = t->stk+8; - t->context.uc.uc_stack.ss_size = t->stksize-16; - makecontext(&t->context.uc, (void(*)())launcher, 2, f, arg); -} - -void -_threadinswitch(int enter) -{ - USED(enter); -} - -void -_threadstacklimit(void *bottom, void *top) -{ - USED(bottom); - USED(top); -} - -void -_swaplabel(Label *old, Label *new) -{ - if(swapcontext(&old->uc, &new->uc) < 0) - sysfatal("swapcontext: %r"); -} - |
