Blender V5.3
BLI_mutex.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2025 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11/* Always include that so that `BLI_mutex.hh` can be used as replacement to including <mutex>.
12 * Otherwise it might be confusing if both are included explicitly in a file. That also makes the
13 * difference between compiling with and without TBB smaller. */
14#include <mutex> // IWYU pragma: export
15
16#ifdef WITH_TBB
17# include <tbb/mutex.h>
18#endif
19
20namespace blender {
21
22#ifdef WITH_TBB
23
43using Mutex = tbb::mutex;
44
45/* If this is not true anymore at some point, the comment above needs to be updated. */
46static_assert(sizeof(Mutex) == 1);
47
48#else
49
51using Mutex = std::mutex;
52
53#endif
54
55} // namespace blender
BMesh Iterators.
std::mutex Mutex
Definition BLI_mutex.hh:51