diff options
-rw-r--r-- | include/mux.h | 2 | ||||
-rw-r--r-- | src/libmux/mux.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/include/mux.h b/include/mux.h index c43ce797..b8d242c8 100644 --- a/include/mux.h +++ b/include/mux.h @@ -22,7 +22,7 @@ struct Mux void *aux; /* for private use by client */ /* private */ - QLock lk; + QLock lk; /* must be first for muxinit */ QLock inlk; QLock outlk; Rendez tagrend; diff --git a/src/libmux/mux.c b/src/libmux/mux.c index bc632602..2d5074ee 100644 --- a/src/libmux/mux.c +++ b/src/libmux/mux.c @@ -19,7 +19,9 @@ static void dequeue(Mux*, Muxrpc*); void muxinit(Mux *mux) { + memset(&mux->lk, 0, sizeof(Mux)-offsetof(Mux, lk)); mux->tagrend.l = &mux->lk; + mux->rpcfork.l = &mux->lk; mux->sleep.next = &mux->sleep; mux->sleep.prev = &mux->sleep; } |