From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Sat, 29 Sep 2007 18:17:11 +0200 From: Martin Neubauer To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> Subject: Re: [9fans] Page problems Message-ID: <20070929161711.GD801@shodan.homeunix.net> References: <20070929152846.GC801@shodan.homeunix.net> <53f12eb5933a22903e38de7a0c9f6a19@quanstro.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53f12eb5933a22903e38de7a0c9f6a19@quanstro.net> User-Agent: Mutt/1.4.2.3i Topicbox-Message-UUID: c77a70a4-ead2-11e9-9d60-3106f5b1d025 * erik quanstrom (quanstro@quanstro.net) wrote: > if this is a timing issue, then that should be addressed. if your diagnosis is > correct, then if pagecache would slept until the event loop were running, > that would fix the timing problem. > > maybe something like > > int eventdawn; /* set after event loop is fired up */ > > Image* > cachedpage(Document *doc, int angle, int page) > { > static int lastpage = -1; > static int rabusy; > Image *im; > int ra; > > + while(eventdawn == 0) > + sleep(1); I'm afraid in this instance this wouldn't help. The control flow is smething like main -> viewer -> { showpage -> cachedpage ; event loop }. Maybe the following would better: void viewer(Document *dd) { . . . midmenu.item = miditems; midmenu.gen = 0; midmenu.lasthit = Next; < showpage(page, &menu); --- > if(doc->npage > 0) > showpage(page, &menu); esetcursor(nil); Martin