Blender V4.3
lazy_threading.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
6#include "BLI_stack.hh"
7#include "BLI_vector.hh"
8
10
17static thread_local HintReceivers hint_receivers = []() {
18 HintReceivers receivers;
19 /* Make sure there is always at least one vector. */
20 receivers.push_as();
21 return receivers;
22}();
23
25{
26 for (const FunctionRef<void()> &fn : hint_receivers.peek()) {
27 fn();
28 }
29}
30
32{
33 hint_receivers.peek().append(fn);
34}
35
40
45
51
52} // namespace blender::lazy_threading
#define BLI_assert(a)
Definition BLI_assert.h:50
void push_as(ForwardT &&...value)
Definition BLI_stack.hh:222
HintReceiver(FunctionRef< void()> fn)
static thread_local HintReceivers hint_receivers