aboutsummaryrefslogtreecommitdiff
path: root/src/lib9/rendez.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2004-12-26 21:51:15 +0000
committerrsc <devnull@localhost>2004-12-26 21:51:15 +0000
commit5f8fa94796903bf81db4f1dc76d433a80308b3d4 (patch)
treebc94c36965c4bf6cdb420c4c5fe628024647f88e /src/lib9/rendez.c
parentb2ff5382580e13d82ca48966c9d79d3318865cba (diff)
downloadplan9port-5f8fa94796903bf81db4f1dc76d433a80308b3d4.tar.gz
plan9port-5f8fa94796903bf81db4f1dc76d433a80308b3d4.tar.bz2
plan9port-5f8fa94796903bf81db4f1dc76d433a80308b3d4.zip
cleanups - lots of removed files now in thread library.
qlock.c - stubs to thread library notify.c - clean interface slightly.
Diffstat (limited to 'src/lib9/rendez.c')
-rw-r--r--src/lib9/rendez.c42
1 files changed, 0 insertions, 42 deletions
diff --git a/src/lib9/rendez.c b/src/lib9/rendez.c
deleted file mode 100644
index 2b2c1a19..00000000
--- a/src/lib9/rendez.c
+++ /dev/null
@@ -1,42 +0,0 @@
-#include <u.h>
-#include <libc.h>
-#include "9proc.h"
-
-static Lock rendlock;
-static Uproc *rendhash[RENDHASH];
-
-ulong
-rendezvous(ulong tag, ulong val)
-{
- char c;
- ulong ret;
- Uproc *t, *self, **l;
-
- self = _p9uproc(0);
- lock(&rendlock);
- l = &rendhash[tag%RENDHASH];
- for(t=*l; t; l=&t->rendhash, t=*l){
- if(t->rendtag==tag){
- *l = t->rendhash;
- ret = t->rendval;
- t->rendval = val;
- t->rendtag++;
- c = 0;
- unlock(&rendlock);
- write(t->pipe[1], &c, 1);
- return ret;
- }
- }
-
- /* Going to sleep here. */
- t = self;
- t->rendtag = tag;
- t->rendval = val;
- t->rendhash = *l;
- *l = t;
- unlock(&rendlock);
- do
- read(t->pipe[0], &c, 1);
- while(t->rendtag == tag);
- return t->rendval;
-}