Re: [PATCH libX11] Always initialise thread support

2013-09-12 Thread Michal Suchanek
Hello, On 14 July 2013 18:31, Daniel Stone dan...@fooishbar.org wrote: Hi, On 14 July 2013 17:17, Mark Kettenis mark.kette...@xs4all.nl wrote: Make XOpenDisplay always call XInitThreads when opening a display, thus guarding it against possible disaster scenarios like calling XOpenDisplay

Re: [PATCH libX11] Always initialise thread support

2013-07-14 Thread Daniel Stone
Hi, On 14 July 2013 17:17, Mark Kettenis mark.kette...@xs4all.nl wrote: Make XOpenDisplay always call XInitThreads when opening a display, thus guarding it against possible disaster scenarios like calling XOpenDisplay without XInitThreads, then passing the Display pointer into an EGL library

Re: [PATCH libX11] Always initialise thread support

2013-07-13 Thread Samuel Thibault
Hello, Couldn't pthread_once be used in order to make sure initialization happens only once? Samuel ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel

[PATCH libX11] Always initialise thread support

2013-07-12 Thread Daniel Stone
Make XOpenDisplay always call XInitThreads when opening a display, thus guarding it against possible disaster scenarios like calling XOpenDisplay without XInitThreads, then passing the Display pointer into an EGL library which uses threads. Or any of the other five similar failure scenarios I've

Re: [PATCH libX11] Always initialise thread support

2013-07-12 Thread Jamey Sharp
Hmm. XInitThreads wasn't designed to be used this way. For instance, initializing thread support isn't thread-safe, for fairly obvious reasons. This patch might mask more bugs than it causes, and thereby be a net win. But it seems equally likely to turn out the other way. I'd suggest an awful

Re: [PATCH libX11] Always initialise thread support

2013-07-12 Thread Samuel Thibault
Daniel Stone, le Fri 12 Jul 2013 22:25:38 +0100, a écrit : Make XOpenDisplay always call XInitThreads when opening a display, thus guarding it against possible disaster scenarios like calling XOpenDisplay without XInitThreads, then passing the Display pointer into an EGL library which uses

Re: [PATCH libX11] Always initialise thread support

2013-07-12 Thread Daniel Stone
Hi, On 12 July 2013 22:40, Jamey Sharp ja...@minilop.net wrote: Hmm. XInitThreads wasn't designed to be used this way. For instance, initializing thread support isn't thread-safe, for fairly obvious reasons. This patch might mask more bugs than it causes, and thereby be a net win. But it

Re: [PATCH libX11] Always initialise thread support

2013-07-12 Thread Jamey Sharp
On Fri, Jul 12, 2013 at 11:16:16PM +0100, Daniel Stone wrote: On 12 July 2013 22:40, Jamey Sharp ja...@minilop.net wrote: Hmm. XInitThreads wasn't designed to be used this way. For instance, initializing thread support isn't thread-safe, for fairly obvious reasons. This patch might mask

Re: [PATCH libX11] Always initialise thread support

2013-07-12 Thread Alan Coopersmith
On 07/12/13 03:16 PM, Daniel Stone wrote: The immediate provocation was the Mali GLES/EGL implementation, which uses multiple threads itself, and thus relies on XInitThreads having been called somewhere; so if you ever use that specific implementation, every app has to call XInitThreads first to

Re: [PATCH libX11] Always initialise thread support

2013-07-12 Thread Jamey Sharp
On Fri, Jul 12, 2013 at 05:09:00PM -0700, Alan Coopersmith wrote: On 07/12/13 03:16 PM, Daniel Stone wrote: The immediate provocation was the Mali GLES/EGL implementation, which uses multiple threads itself, and thus relies on XInitThreads having been called somewhere; so if you ever use that