diff options
author | Chia-I Wu <olvaffe@gmail.com> | 2009-07-10 15:28:55 +0800 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2009-08-24 11:46:15 -0600 |
commit | 17090cf3efb0db8fa01b502a9c0df27cbd1a67da (patch) | |
tree | 60b29d7e22a9326b8747dbb4a3d5fa495b9b758c /windows/VC8/mesa | |
parent | 3076d1617db67d49ff773096123c1fa47af58272 (diff) |
glapi: Fix a possible race in getting current context/dispatch.
There is a possbile race that _glapi_Context is reset by another thread
after it is tested in GET_CURRENT_CONTEXT but before it is returned. We
definitely do not want a lock here to solve the race. To have correct
results even under a race, no other threads should reset _glapi_Context
(or _glapi_Dispatch).
This patch adds a new global variable _glapi_SingleThreaded. Since
_glapi_Context or _glapi_Dispatch are no longer reset,
_glapi_SingleThreaded is tested instead, before accessing them.
DRI drivers compiled with this patch applied will not work with existing
libGL.so because of the missing new symbol. If this turns out to be a
real problem, this patch should be reverted.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Diffstat (limited to 'windows/VC8/mesa')
0 files changed, 0 insertions, 0 deletions