summaryrefslogtreecommitdiffstats
path: root/core/templates/command_queue_mt.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2024-04-04 10:18:08 +0200
committerPedro J. Estébanez <pedrojrulez@gmail.com>2024-04-10 18:47:42 +0200
commit65686dedf9778e829287f63c7179a523d44fa085 (patch)
treee0f5b969bd28d7937291a8efab12a1063109d313 /core/templates/command_queue_mt.cpp
parentc28f5901c7f9ac8885032f9b30db788e08e72911 (diff)
downloadredot-engine-65686dedf9778e829287f63c7179a523d44fa085.tar.gz
Use WorkerThreadPool for Server threads
* Servers now use WorkerThreadPool for background computation. * This helps keep the number of threads used fixed at all times. * It also ensures everything works on HTML5 with threads. * And makes it easier to support disabling threads for also HTML5. CommandQueueMT now syncs with the servers via the WorkerThreadPool yielding mechanism, which makes its classic main sync semaphore superfluous. Also, some warnings about calls that kill performance when using threaded rendering are removed because there's a mechanism that warns about that in a more general fashion. Co-authored-by: Pedro J. Estébanez <pedrojrulez@gmail.com>
Diffstat (limited to 'core/templates/command_queue_mt.cpp')
-rw-r--r--core/templates/command_queue_mt.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/core/templates/command_queue_mt.cpp b/core/templates/command_queue_mt.cpp
index 6ecd75ebc1..0c5c6394a1 100644
--- a/core/templates/command_queue_mt.cpp
+++ b/core/templates/command_queue_mt.cpp
@@ -70,14 +70,8 @@ CommandQueueMT::SyncSemaphore *CommandQueueMT::_alloc_sync_sem() {
return &sync_sems[idx];
}
-CommandQueueMT::CommandQueueMT(bool p_sync) {
- if (p_sync) {
- sync = memnew(Semaphore);
- }
+CommandQueueMT::CommandQueueMT() {
}
CommandQueueMT::~CommandQueueMT() {
- if (sync) {
- memdelete(sync);
- }
}