-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Chia-I Wu wrote:
> If multiple threads set/get a TSD at roughly same time for the first
> time, glthread might (wronly) initialize it more than once.  This patch
> solves the race by initializing context/dispatch TSDs early.

Acked-by: Ian Romanick <[email protected]>

> ---
>  src/mesa/glapi/glapi.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c
> index 30aec20..b9ab9c0 100644
> --- a/src/mesa/glapi/glapi.c
> +++ b/src/mesa/glapi/glapi.c
> @@ -240,6 +240,10 @@ _glapi_check_multithread(void)
>  
>     _glthread_LOCK_MUTEX(ThreadCheckMutex);
>     if (firstCall) {
> +      /* initialize TSDs */
> +      (void) _glthread_GetTSD(&ContextTSD);
> +      (void) _glthread_GetTSD(&_gl_DispatchTSD);
> +
>        knownID = _glthread_GetID();
>        firstCall = GL_FALSE;
>     }

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkpXjkMACgkQX1gOwKyEAw+viwCePoHHbGYgJKRF6p0+ulwew1Ng
CCkAn1H9hVwjAY0yudpwQ6cqUcar2yYN
=X+dt
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to