diff options
author | rsc <devnull@localhost> | 2006-11-04 18:46:00 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2006-11-04 18:46:00 +0000 |
commit | 3a19470202c5c0f6e9375e5d57535c3d508f2edf (patch) | |
tree | e6aa1a9064555616bff5488af87d09004efcd279 /include | |
parent | d3864abaee496db2f97dff1dbf5c7766d4439c7b (diff) | |
download | plan9port-3a19470202c5c0f6e9375e5d57535c3d508f2edf.tar.gz plan9port-3a19470202c5c0f6e9375e5d57535c3d508f2edf.tar.bz2 plan9port-3a19470202c5c0f6e9375e5d57535c3d508f2edf.zip |
In non-blocking recv functions in libmux and libdraw,
distinguish between "cannot receive without blocking"
and "EOF on connection".
In libmux, do not elect async guys muxers, so that
synchronous RPC calls run in the main event loop
(e.g., in eresized) do not get stuck.
Fixes problem reported by Lu Xuxiao, namely that
jpg etc. would spin at 100% cpu usage.
Diffstat (limited to 'include')
-rw-r--r-- | include/mux.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/include/mux.h b/include/mux.h index 53321fa5..e9890fc3 100644 --- a/include/mux.h +++ b/include/mux.h @@ -19,6 +19,7 @@ struct Muxrpc uint tag; void *p; int waiting; + int async; }; struct Mux @@ -27,7 +28,7 @@ struct Mux uint maxtag; int (*send)(Mux*, void*); void *(*recv)(Mux*); - void *(*nbrecv)(Mux*); + int (*nbrecv)(Mux*, void**); int (*gettag)(Mux*, void*); int (*settag)(Mux*, void*, uint); void *aux; /* for private use by client */ @@ -52,18 +53,18 @@ void muxinit(Mux*); void* muxrpc(Mux*, void*); void muxprocs(Mux*); Muxrpc* muxrpcstart(Mux*, void*); -void* muxrpccanfinish(Muxrpc*); +int muxrpccanfinish(Muxrpc*, void**); /* private */ int _muxsend(Mux*, void*); -void* _muxrecv(Mux*, int); +int _muxrecv(Mux*, int, void**); void _muxsendproc(void*); void _muxrecvproc(void*); Muxqueue *_muxqalloc(void); int _muxqsend(Muxqueue*, void*); void *_muxqrecv(Muxqueue*); void _muxqhangup(Muxqueue*); -void *_muxnbqrecv(Muxqueue*); +int _muxnbqrecv(Muxqueue*, void**); #if defined(__cplusplus) } |