1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:07:34 +00:00

Kernel: Use atomic integer for next FIFO id

This commit is contained in:
Jean-Baptiste Boric 2021-07-18 11:45:13 +02:00 committed by Andreas Kling
parent 738e604bfc
commit 25d7beec6b

View file

@ -4,6 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <AK/Atomic.h>
#include <AK/HashTable.h> #include <AK/HashTable.h>
#include <AK/Singleton.h> #include <AK/Singleton.h>
#include <AK/StdLibExtras.h> #include <AK/StdLibExtras.h>
@ -23,7 +24,7 @@ static Lockable<HashTable<FIFO*>>& all_fifos()
return *s_table; return *s_table;
} }
static int s_next_fifo_id = 1; static Atomic<int> s_next_fifo_id = 1;
RefPtr<FIFO> FIFO::try_create(uid_t uid) RefPtr<FIFO> FIFO::try_create(uid_t uid)
{ {