summaryrefslogtreecommitdiff
path: root/Kernel/FileSystem
diff options
context:
space:
mode:
authorJean-Baptiste Boric <jblbeurope@gmail.com>2021-07-18 11:45:13 +0200
committerAndreas Kling <kling@serenityos.org>2021-08-07 11:48:00 +0200
commit25d7beec6bbc189155a87212781b0281fd214c91 (patch)
treec41823afa39e6946a2ffad53c43dd8b50dda8db8 /Kernel/FileSystem
parent738e604bfc9c568a1267fa6ada5f66860d4692b7 (diff)
downloadserenity-25d7beec6bbc189155a87212781b0281fd214c91.zip
Kernel: Use atomic integer for next FIFO id
Diffstat (limited to 'Kernel/FileSystem')
-rw-r--r--Kernel/FileSystem/FIFO.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Kernel/FileSystem/FIFO.cpp b/Kernel/FileSystem/FIFO.cpp
index 62aab80058..87a5c4e628 100644
--- a/Kernel/FileSystem/FIFO.cpp
+++ b/Kernel/FileSystem/FIFO.cpp
@@ -4,6 +4,7 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
+#include <AK/Atomic.h>
#include <AK/HashTable.h>
#include <AK/Singleton.h>
#include <AK/StdLibExtras.h>
@@ -23,7 +24,7 @@ static Lockable<HashTable<FIFO*>>& all_fifos()
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)
{