From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Thu, 23 Aug 2012 11:47:14 +0200 From: cinap_lenrek@gmx.de To: 9fans@9fans.net In-Reply-To: <2558025d29ad87b629bc88c6e6a043a3@kw.quanstro.net> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] devmnt crash, fix. Topicbox-Message-UUID: ae3e7388-ead7-11e9-9d60-3106f5b1d025 can you provide the source file, dont have current 9atom iso handy and the stuff i found on the net doesnt seem to cut it. however, i found http://www.quanstro.net/plan9/sleepwake.html which at the end gives a solution to the problem: void dowake(Io *i) { i->cond = 1; wakeup(i); i->cond = 2; /* atomic */ /* hands off i now */ } void doio(void) { Io *i; dispatch(i = malloc(sizeof *i)); while(waserror()) /* eat note */; sleep(i, iodone, i); poperror(); while(i->cond != 2) /* rendez not done */; free(i); } that would be relatively easy to apply to devmnt and doesnt have the problem of spurious wakeups with abusing up->sleep as rendez. -- cinap