URI:
       tthread.c - plan9port - [fork] Plan 9 from user space
  HTML git clone git://src.adamsgaard.dk/plan9port
   DIR Log
   DIR Files
   DIR Refs
   DIR README
   DIR LICENSE
       ---
       tthread.c (464B)
       ---
            1 /* Copyright (C) 2003 Russ Cox, Massachusetts Institute of Technology */
            2 /* See COPYRIGHT */
            3 
            4 #include <u.h>
            5 #include <libc.h>
            6 #include <thread.h>
            7 #include <mux.h>
            8 
            9 enum
           10 {
           11         STACK = 32768
           12 };
           13 
           14 void
           15 muxprocs(Mux *mux)
           16 {
           17         proccreate(_muxrecvproc, mux, STACK);
           18         qlock(&mux->lk);
           19         while(!mux->readq)
           20                 rsleep(&mux->rpcfork);
           21         qunlock(&mux->lk);
           22         proccreate(_muxsendproc, mux, STACK);
           23         qlock(&mux->lk);
           24         while(!mux->writeq)
           25                 rsleep(&mux->rpcfork);
           26         qunlock(&mux->lk);
           27 }