mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
nbrecv
This commit is contained in:
parent
eacc13ea5c
commit
c02bc16b4b
1 changed files with 8 additions and 3 deletions
|
@ -12,11 +12,13 @@ typedef struct Muxqueue Muxqueue;
|
||||||
|
|
||||||
struct Muxrpc
|
struct Muxrpc
|
||||||
{
|
{
|
||||||
|
Mux *mux;
|
||||||
Muxrpc *next;
|
Muxrpc *next;
|
||||||
Muxrpc *prev;
|
Muxrpc *prev;
|
||||||
Rendez r;
|
Rendez r;
|
||||||
uint tag;
|
uint tag;
|
||||||
void *p;
|
void *p;
|
||||||
|
int waiting;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Mux
|
struct Mux
|
||||||
|
@ -25,6 +27,7 @@ struct Mux
|
||||||
uint maxtag;
|
uint maxtag;
|
||||||
int (*send)(Mux*, void*);
|
int (*send)(Mux*, void*);
|
||||||
void *(*recv)(Mux*);
|
void *(*recv)(Mux*);
|
||||||
|
void *(*nbrecv)(Mux*);
|
||||||
int (*gettag)(Mux*, void*);
|
int (*gettag)(Mux*, void*);
|
||||||
int (*settag)(Mux*, void*, uint);
|
int (*settag)(Mux*, void*, uint);
|
||||||
void *aux; /* for private use by client */
|
void *aux; /* for private use by client */
|
||||||
|
@ -41,17 +44,19 @@ struct Mux
|
||||||
uint mwait;
|
uint mwait;
|
||||||
uint freetag;
|
uint freetag;
|
||||||
Muxrpc **wait;
|
Muxrpc **wait;
|
||||||
uint muxer;
|
Muxrpc *muxer;
|
||||||
Muxrpc sleep;
|
Muxrpc sleep;
|
||||||
};
|
};
|
||||||
|
|
||||||
void muxinit(Mux*);
|
void muxinit(Mux*);
|
||||||
void* muxrpc(Mux*, void*);
|
void* muxrpc(Mux*, void*);
|
||||||
void muxthreads(Mux*);
|
void muxprocs(Mux*);
|
||||||
|
Muxrpc* muxrpcstart(Mux*, void*);
|
||||||
|
void* muxrpccanfinish(Muxrpc*);
|
||||||
|
|
||||||
/* private */
|
/* private */
|
||||||
int _muxsend(Mux*, void*);
|
int _muxsend(Mux*, void*);
|
||||||
void* _muxrecv(Mux*);
|
void* _muxrecv(Mux*, int);
|
||||||
void _muxsendproc(void*);
|
void _muxsendproc(void*);
|
||||||
void _muxrecvproc(void*);
|
void _muxrecvproc(void*);
|
||||||
Muxqueue *_muxqalloc(void);
|
Muxqueue *_muxqalloc(void);
|
||||||
|
|
Loading…
Reference in a new issue