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/sleep.c | |
| parent | 7788fd54094693384ef5c92c475656dba8819feb (diff) | |
| download | plan9port-1544f90960275dc9211bde30329c3258e0e1bf38.tar.gz plan9port-1544f90960275dc9211bde30329c3258e0e1bf38.zip | |
New thread library
Diffstat (limited to 'src/libthread/sleep.c')
| -rw-r--r-- | src/libthread/sleep.c | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/src/libthread/sleep.c b/src/libthread/sleep.c deleted file mode 100644 index 4b0d82a1..00000000 --- a/src/libthread/sleep.c +++ /dev/null @@ -1,39 +0,0 @@ -#include "threadimpl.h" - -int _threadhighnrendez; -int _threadnrendez; - -void -_threadsleep(_Procrend *r) -{ - Thread *t; - - t = _threadgetproc()->thread; - r->arg = t; - t->nextstate = Rendezvous; - t->asleep = 1; - unlock(r->l); - _sched(); - t->asleep = 0; - lock(r->l); -} - -void -_threadwakeup(_Procrend *r) -{ - Thread *t; - - t = r->arg; - while(t->state == Running) - sleep(0); - lock(&t->proc->lock); - if(t->state == Dead){ - unlock(&t->proc->lock); - return; - } - assert(t->state == Rendezvous && t->asleep); - t->state = Ready; - _threadready(t); - unlock(&t->proc->lock); -} - |
