nanogui: expected mutex behaviour in client.c ?
Subject:
Re: expected mutex behaviour in client.c ?
From:
"Aaron J. Grier" ####@####.####
Date:
7 Mar 2005 17:53:24 +0000
Message-Id: <20050307175236.GC13345@mordor.unix.fryenet>
On Tue, Mar 01, 2005 at 04:24:38PM +0100, David LIBAULT wrote:
> When calling function
>
> void GrGetScreenInfo(GR_SCREEN_INFO *sip)
>
> int client.c, the global lock nxGlobalLock is locked (so that the current
> thread will be the only one to access/modify global data).
>
> But after that TypedReadBlock(..) is called which in turn calls
> CheckBlockType(...) which calls ReadBlock(...) which calls nxFlushReq(0L,0)
> (in file nxproto.c) which tries to lock the nxGlobalLock (again)...
>
> Any function calling GrGetScreenInfo would lock itself !
>
> What am I missing ?
use simple binary semaphores instead of counting ones. IE allow a
thread to re-lock a lock it already holds.
--
Aaron J. Grier | Frye Electronics, Tigard, OR | ####@####.####