llvmpipe/fence: make the fence id counter atomic

Multiple threads can race on the function static variable

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16348>
This commit is contained in:
Karol Herbst 2022-04-03 12:47:58 +02:00 committed by Marge Bot
parent 8cc1889b09
commit 3269d34b29

View file

@ -44,7 +44,7 @@
struct lp_fence *
lp_fence_create(unsigned rank)
{
static int fence_id;
static _Atomic int fence_id;
struct lp_fence *fence = CALLOC_STRUCT(lp_fence);
if (!fence)