aboutsummaryrefslogtreecommitdiff
path: root/src/libthread/channel.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2004-09-17 03:34:32 +0000
committerrsc <devnull@localhost>2004-09-17 03:34:32 +0000
commitbcf527a98e295548629620a7cb06ada951db7822 (patch)
tree0c459268d6391745a7acc3fefb82ba1e62ed858e /src/libthread/channel.c
parent06bb4ed20d855b60e39c1125d8d715ba8892265b (diff)
downloadplan9port-bcf527a98e295548629620a7cb06ada951db7822.tar.gz
plan9port-bcf527a98e295548629620a7cb06ada951db7822.tar.bz2
plan9port-bcf527a98e295548629620a7cb06ada951db7822.zip
Continue switching library over to pthreads when possible.
Tprimes works on Linux 2.6. You can only have 128 procs though.
Diffstat (limited to 'src/libthread/channel.c')
-rw-r--r--src/libthread/channel.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libthread/channel.c b/src/libthread/channel.c
index cdb8376e..14791d05 100644
--- a/src/libthread/channel.c
+++ b/src/libthread/channel.c
@@ -29,7 +29,7 @@ canexec(Alt *a)
/* are there senders or receivers blocked? */
otherop = (CHANSND+CHANRCV) - a->op;
for(i=0; i<c->nentry; i++)
- if(c->qentry[i] && c->qentry[i]->op==otherop && c->qentry[i]->thread==nil){
+ if(c->qentry[i] && c->qentry[i]->op==otherop && c->qentry[i]->thread->altc==nil){
_threaddebug(DBGCHAN, "can rendez alt %p chan %p", a, c);
return 1;
}
@@ -460,7 +460,7 @@ altexec(Alt *a, int spl)
b = nil;
me = a->v;
for(i=0; i<c->nentry; i++)
- if(c->qentry[i] && c->qentry[i]->op==otherop && c->qentry[i]->thread==nil)
+ if(c->qentry[i] && c->qentry[i]->op==otherop && c->qentry[i]->thread->altc==nil)
if(nrand(++n) == 0)
b = c->qentry[i];
if(b != nil){
@@ -488,7 +488,7 @@ altexec(Alt *a, int spl)
altcopy(waiter, me, c->e);
}
b->thread->altc = c;
- _procwakeup(&b->thread->altrend);
+ _threadwakeup(&b->thread->altrend);
_threaddebug(DBGCHAN, "chanlock is %lud", *(ulong*)(void*)&chanlock);
_threaddebug(DBGCHAN, "unlocking the chanlock");
unlock(&chanlock);