Blender
V4.3
source
blender
depsgraph
intern
depsgraph_writeback_sync.cc
Go to the documentation of this file.
1
/* SPDX-FileCopyrightText: 2024 Blender Authors
2
*
3
* SPDX-License-Identifier: GPL-2.0-or-later */
4
5
#include <mutex>
6
7
#include "
DEG_depsgraph.hh
"
8
#include "
DEG_depsgraph_writeback_sync.hh
"
9
10
#include "
BLI_map.hh
"
11
12
#include "
depsgraph.hh
"
13
14
namespace
blender::deg::sync_writeback
{
15
16
void
add
(::Depsgraph &
depsgraph
, std::function<
void
()> fn)
17
{
18
deg::Depsgraph
°_graph =
reinterpret_cast<
deg::Depsgraph
&
>
(
depsgraph
);
19
if
(!deg_graph.
is_active
) {
20
return
;
21
}
22
23
std::lock_guard
lock
{deg_graph.
sync_writeback_callbacks_mutex
};
24
deg_graph.
sync_writeback_callbacks
.
append
(std::move(fn));
25
}
26
27
}
// namespace blender::deg::sync_writeback
BLI_map.hh
DEG_depsgraph.hh
DEG_depsgraph_writeback_sync.hh
lock
volatile int lock
Definition
atomic_ops_unix.h:0
blender::Vector::append
void append(const T &value)
Definition
BLI_vector.hh:430
depsgraph
const Depsgraph * depsgraph
Definition
deg_eval_copy_on_write.cc:494
depsgraph.hh
blender::deg::sync_writeback
Definition
DEG_depsgraph_writeback_sync.hh:22
blender::deg::sync_writeback::add
void add(Depsgraph &depsgraph, std::function< void()> fn)
blender::deg::Depsgraph
Definition
depsgraph.hh:47
blender::deg::Depsgraph::sync_writeback_callbacks
Vector< std::function< void()> > sync_writeback_callbacks
Definition
depsgraph.hh:185
blender::deg::Depsgraph::is_active
bool is_active
Definition
depsgraph.hh:154
blender::deg::Depsgraph::sync_writeback_callbacks_mutex
std::mutex sync_writeback_callbacks_mutex
Definition
depsgraph.hh:187
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0