Thanks a lot Brian. BR, Awais
________________________________________ From: Brian Paul [bri...@vmware.com] Sent: Wednesday, October 14, 2015 7:19 PM To: Belal, Awais; mesa-dev@lists.freedesktop.org Subject: Re: [Mesa-dev] [mesa-dev, mesa-demos][PATCH] sharedtex_mt: fix rendering thread hang I just pushed it. Thanks. -Brian On 10/14/2015 02:07 AM, Belal, Awais wrote: > Hi Brian, > > Do you want me to update this or is it good to go as is? > > BR, > Awais > > ________________________________________ > From: mesa-dev [mesa-dev-boun...@lists.freedesktop.org] on behalf of Belal, > Awais > Sent: Monday, October 12, 2015 6:33 PM > To: Brian Paul; mesa-dev@lists.freedesktop.org > Subject: Re: [Mesa-dev] [mesa-dev, mesa-demos][PATCH] sharedtex_mt: fix > rendering thread hang > > Hi Brian, > > Thanks for your reply :) > The move of variable definition was just to make the code look a little > cleaner. > > BR, > Awais > > ________________________________________ > From: Brian Paul [bri...@vmware.com] > Sent: Monday, October 12, 2015 6:31 PM > To: Belal, Awais; mesa-dev@lists.freedesktop.org > Subject: Re: [Mesa-dev] [mesa-dev, mesa-demos][PATCH] sharedtex_mt: fix > rendering thread hang > > On 10/12/2015 05:25 AM, Belal, Awais wrote: >> Hi, >> >> Is there are a reservation against the below patch? > > Looks OK, but one comment below. > > >> BR, >> Awais >> >> ________________________________________ >> From: mesa-dev [mesa-dev-boun...@lists.freedesktop.org] on behalf of Belal, >> Awais >> Sent: Thursday, October 08, 2015 2:00 PM >> To: mesa-dev@lists.freedesktop.org >> Subject: [Mesa-dev] [mesa-dev, mesa-demos][PATCH] sharedtex_mt: fix >> rendering thread hang >> >> XNextEvent is a blocking call which locks up the display mutex >> this causes the rendering threads to hang when they try call >> glXSwapBuffers() as that tries to take the same mutex in >> underlying calls through XCopyArea(). >> So we only go to XNextEvent when it has at least one event >> and we wouldn't lock indefinitely. >> >> Signed-off-by: Awais Belal <awais_be...@mentor.com> >> --- >> src/xdemos/sharedtex_mt.c | 9 +++++++-- >> 1 file changed, 7 insertions(+), 2 deletions(-) >> >> diff --git a/src/xdemos/sharedtex_mt.c b/src/xdemos/sharedtex_mt.c >> index a90903a..1d503c4 100644 >> --- a/src/xdemos/sharedtex_mt.c >> +++ b/src/xdemos/sharedtex_mt.c >> @@ -420,9 +420,14 @@ Resize(struct window *h, unsigned int width, unsigned >> int height) >> static void >> EventLoop(void) >> { >> + int i; >> + XEvent event; >> while (1) { >> - int i; >> - XEvent event; >> + /* Do we have an event? */ >> + if (XPending(gDpy) == 0) { >> + usleep(10000); >> + continue; >> + } >> XNextEvent(gDpy, &event); >> for (i = 0; i < NumWindows; i++) { >> struct window *h = &Windows[i]; > > Was there particular reason to move the i, event declarations? > > In any case, I'll commit this in a bit. > > -Brian > > _______________________________________________ > mesa-dev mailing list > mesa-dev@lists.freedesktop.org > https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.freedesktop.org_mailman_listinfo_mesa-2Ddev&d=BQIFAg&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=T0t4QG7chq2ZwJo6wilkFznRSFy-8uDKartPGbomVj8&m=OGzLAaED2FXBhL6Q1sLFgviEkbFMzCA_bTROi2XgqJA&s=o_lPvn53_4RWhqKWa6ZyyfO1l6b2SzQMpEL6OtZc6y8&e= > _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev