mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-30 11:54:57 +00:00
27 lines
467 B
C
27 lines
467 B
C
/* Copyright (C) 2003 Russ Cox, Massachusetts Institute of Technology */
|
|
/* See COPYRIGHT */
|
|
|
|
#include <u.h>
|
|
#include <libc.h>
|
|
#include <thread.h>
|
|
#include <mux.h>
|
|
|
|
enum
|
|
{
|
|
STACK = 32768
|
|
};
|
|
|
|
void
|
|
muxthreads(Mux *mux)
|
|
{
|
|
proccreate(_muxrecvproc, mux, STACK);
|
|
qlock(&mux->lk);
|
|
while(!mux->writeq)
|
|
rsleep(&mux->rpcfork);
|
|
qunlock(&mux->lk);
|
|
proccreate(_muxsendproc, mux, STACK);
|
|
qlock(&mux->lk);
|
|
while(!mux->writeq)
|
|
rsleep(&mux->rpcfork);
|
|
qunlock(&mux->lk);
|
|
}
|