Re: [Mesa-dev] [PATCH 1/2] c11/threads: implement thrd_current on Windows

2017-04-24 Thread Jose Fonseca
On 24/04/17 16:46, Emil Velikov wrote: On 24 April 2017 at 12:56, Jose Fonseca wrote: On 24/04/17 12:26, Emil Velikov wrote: On 21 April 2017 at 16:45, Jose Fonseca wrote: I reread http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf and is not explicit. But I checked C11 threads.h i

Re: [Mesa-dev] [PATCH 1/2] c11/threads: implement thrd_current on Windows

2017-04-24 Thread Emil Velikov
On 24 April 2017 at 12:56, Jose Fonseca wrote: > On 24/04/17 12:26, Emil Velikov wrote: >> >> On 21 April 2017 at 16:45, Jose Fonseca wrote: >>> >>> I reread http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf and is >>> not explicit. >>> >>> But I checked C11 threads.h implementation and t

Re: [Mesa-dev] [PATCH 1/2] c11/threads: implement thrd_current on Windows

2017-04-24 Thread Jose Fonseca
On 24/04/17 12:26, Emil Velikov wrote: On 21 April 2017 at 16:45, Jose Fonseca wrote: I reread http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf and is not explicit. But I checked C11 threads.h implementation and thrd_current also uses DuplicateHandle. So C11/threads_win32.h is correc

Re: [Mesa-dev] [PATCH 1/2] c11/threads: implement thrd_current on Windows

2017-04-24 Thread Emil Velikov
On 21 April 2017 at 16:45, Jose Fonseca wrote: > I reread http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf and is > not explicit. > > But I checked C11 threads.h implementation and thrd_current also uses > DuplicateHandle. > > So C11/threads_win32.h is correct. And ISO C11 standard commi

Re: [Mesa-dev] [PATCH 1/2] c11/threads: implement thrd_current on Windows

2017-04-21 Thread Jose Fonseca
I reread http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf and is not explicit. But I checked C11 threads.h implementation and thrd_current also uses DuplicateHandle. So C11/threads_win32.h is correct. And ISO C11 standard commited screwed up here. Maybe they'll introduce thread id

Re: [Mesa-dev] [PATCH 1/2] c11/threads: implement thrd_current on Windows

2017-04-21 Thread Jose Fonseca
No, I'm afraid the problem is still there AFAICS. GetCurrentThread returns a magic constant (-2 if I'm not mistaken). So it is (and always will be) useless for thrd_current. Imagine that: - thread #1 invokes thrd_current() and gets -2 - thread #2 invokes thrd_current() and gets -2 - a thread

Re: [Mesa-dev] [PATCH 1/2] c11/threads: implement thrd_current on Windows

2017-04-20 Thread Brian Paul
Series LGTM. Jose should probably take a look too, though. One typo below? Reviewed-by: Brian Paul On 04/20/2017 08:15 AM, Emil Velikov wrote: From: Emil Velikov Earlier commit removed the implementation due to a subtle bug, in the existing code. Namely: One was comparing directly the thr

[Mesa-dev] [PATCH 1/2] c11/threads: implement thrd_current on Windows

2017-04-20 Thread Emil Velikov
From: Emil Velikov Earlier commit removed the implementation due to a subtle bug, in the existing code. Namely: One was comparing directly the thread handle/IDs rather than using thrd_equal(). As the pseudo-handles never matched things went south. That bug was resolved with commit 458c7490c29 "