From 3269d34b29a415e1f0f168ad5cffb0e3a36eeb49 Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Sun, 3 Apr 2022 12:47:58 +0200 Subject: [PATCH] llvmpipe/fence: make the fence id counter atomic Multiple threads can race on the function static variable Signed-off-by: Karol Herbst Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/llvmpipe/lp_fence.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/llvmpipe/lp_fence.c b/src/gallium/drivers/llvmpipe/lp_fence.c index 00cd79d6ba6..7fb24d39046 100644 --- a/src/gallium/drivers/llvmpipe/lp_fence.c +++ b/src/gallium/drivers/llvmpipe/lp_fence.c @@ -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)