You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Start compilation of a pipeline ahead of time in the background. Returns true if the compilation was started, false if it wasn't required. Source is only used for collecting statistics.
DEV_ASSERT((creation_object != nullptr) && (creation_function != nullptr) && "Creation object and function was not set before attempting to compile a pipeline.");
96
97
97
-
// Check if the pipeline was already compiled.
98
-
compiled_queue_mutex.lock();
99
-
bool already_exists = hash_map.has(p_key_hash);
100
-
compiled_queue_mutex.unlock();
101
-
if (already_exists) {
102
-
returnfalse;
103
-
}
104
-
105
-
// Check if the pipeline is currently being compiled.
106
98
MutexLock local_lock(local_mutex);
107
-
if (compilation_tasks.has(p_key_hash)) {
108
-
returnfalse;
99
+
if (compilation_set.has(p_key_hash)) {
100
+
// Check if the pipeline was already submitted.
101
+
return;
109
102
}
110
103
104
+
// Record the pipeline as submitted, a task can't be started for it again.
// Retrieve a pipeline. It'll return an empty pipeline if it's not available yet, but it'll be guaranteed to succeed if 'wait for compilation' is true and stall as necessary. Source is just an optional number to aid debugging.
@@ -155,18 +164,11 @@ class PipelineHashMapRD {
155
164
}
156
165
157
166
if (e == nullptr) {
158
-
// Lock access to the compilation maps.
159
-
MutexLock local_lock(local_mutex);
160
-
161
167
// Request compilation. The method will ignore the request if it's already being compiled.
162
168
compile_pipeline(p_key, p_key_hash, p_source);
163
169
164
170
if (p_wait_for_compilation) {
165
-
if (compilation_tasks.has(p_key_hash)) {
166
-
// If a background compilation task was used, wait for it.
0 commit comments