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:
@@ -44,7 +44,7 @@
|
|||||||
struct lp_fence *
|
struct lp_fence *
|
||||||
lp_fence_create(unsigned rank)
|
lp_fence_create(unsigned rank)
|
||||||
{
|
{
|
||||||
static int fence_id;
|
static _Atomic int fence_id;
|
||||||
struct lp_fence *fence = CALLOC_STRUCT(lp_fence);
|
struct lp_fence *fence = CALLOC_STRUCT(lp_fence);
|
||||||
|
|
||||||
if (!fence)
|
if (!fence)
|
||||||
|
|||||||
Reference in New Issue
Block a user