nanogui: THREADSAFE
Subject:
Re: [nanogui] THREADSAFE
From:
"Greg Haerr" ####@####.####
Date:
1 Mar 2006 22:13:52 +0000
Message-Id: <27ce01c63d7d$631cb570$6401a8c0@winXP>
: I have a little problem. I am trying to make a small nano-X application. I
: have two threads - one sleeping inside GrGetNextEvent and one who is
: trying to make the other wake up by calling GrInjectKeyboardEvent. I have
: enabled THREADSAFE mode but this results in that GrInjectKeyboardEvent is
: blocked by LOCK(&nxGlobalLock), which is locked by the sleeping
: GrGetNextEvent. Is it safe to run this without THREADSAFE mode? If not, is
: there another way to make the GrGetNextEvent thread wake up?
It looks like you're going to have to run this without
THREADSAFE. Both calls eventually call nxFlushReq,
which LOCKs the global lock again, so commenting out
the LOCK in GrInjectKeyboardEvent won't work.
I think you should be OK, since GrInjectKeyboardEvent only
sends data to the server, and never waits for a reply; this is
where the two could otherwise get unsynchronized.
Regards,
Greg