summaryrefslogtreecommitdiff
path: root/sys/src/cmd/unix/drawterm/kern/rendez.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2013-11-23 01:05:33 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2013-11-23 01:05:33 +0100
commit2f9ae0f8ac8610e13ced184847b57b87fe5db580 (patch)
treef9ad2223d518585a2cfe9ea1c73e1e37d07bf637 /sys/src/cmd/unix/drawterm/kern/rendez.c
parentea5797c0731203c09ec5fb7172e77eab2750f1a9 (diff)
removing (outdated) drawterm
drawterm is much better maintained by russ cox, so removing this outdated copy. for a more recent version, go to: http://swtch.com/drawterm/
Diffstat (limited to 'sys/src/cmd/unix/drawterm/kern/rendez.c')
-rw-r--r--sys/src/cmd/unix/drawterm/kern/rendez.c90
1 files changed, 0 insertions, 90 deletions
diff --git a/sys/src/cmd/unix/drawterm/kern/rendez.c b/sys/src/cmd/unix/drawterm/kern/rendez.c
deleted file mode 100644
index 6a9ad174e..000000000
--- a/sys/src/cmd/unix/drawterm/kern/rendez.c
+++ /dev/null
@@ -1,90 +0,0 @@
-#include "u.h"
-#include "lib.h"
-#include "dat.h"
-#include "fns.h"
-#include "error.h"
-
-void
-sleep(Rendez *r, int (*f)(void*), void *arg)
-{
- int s;
-
- s = splhi();
-
- lock(&r->lk);
- lock(&up->rlock);
- if(r->p){
- print("double sleep %lud %lud\n", r->p->pid, up->pid);
- dumpstack();
- }
-
- /*
- * Wakeup only knows there may be something to do by testing
- * r->p in order to get something to lock on.
- * Flush that information out to memory in case the sleep is
- * committed.
- */
- r->p = up;
-
- if((*f)(arg) || up->notepending){
- /*
- * if condition happened or a note is pending
- * never mind
- */
- r->p = nil;
- unlock(&up->rlock);
- unlock(&r->lk);
- } else {
- /*
- * now we are committed to
- * change state and call scheduler
- */
- up->state = Wakeme;
- up->r = r;
-
- /* statistics */
- /* m->cs++; */
-
- unlock(&up->rlock);
- unlock(&r->lk);
-
- procsleep();
- }
-
- if(up->notepending) {
- up->notepending = 0;
- splx(s);
- error(Eintr);
- }
-
- splx(s);
-}
-
-Proc*
-wakeup(Rendez *r)
-{
- Proc *p;
- int s;
-
- s = splhi();
-
- lock(&r->lk);
- p = r->p;
-
- if(p != nil){
- lock(&p->rlock);
- if(p->state != Wakeme || p->r != r)
- panic("wakeup: state");
- r->p = nil;
- p->r = nil;
- p->state = Running;
- procwakeup(p);
- unlock(&p->rlock);
- }
- unlock(&r->lk);
-
- splx(s);
-
- return p;
-}
-