mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 15:21:56 -05:00
Merge commit godotengine/godot@4ebf67c
This commit is contained in:
@@ -37,6 +37,10 @@
|
||||
#include "core/templates/command_queue_mt.h"
|
||||
#include "servers/physics_server_2d.h"
|
||||
|
||||
#define ASYNC_COND_PUSH (Thread::get_caller_id() != server_thread)
|
||||
#define ASYNC_COND_PUSH_AND_RET (Thread::get_caller_id() != server_thread && !(doing_sync.is_set() && Thread::is_main_thread()))
|
||||
#define ASYNC_COND_PUSH_AND_SYNC (Thread::get_caller_id() != server_thread && !(doing_sync.is_set() && Thread::is_main_thread()))
|
||||
|
||||
#ifdef DEBUG_SYNC
|
||||
#define SYNC_DEBUG print_line("sync on: " + String(__FUNCTION__));
|
||||
#else
|
||||
@@ -60,10 +64,12 @@ class PhysicsServer2DWrapMT : public PhysicsServer2D {
|
||||
WorkerThreadPool::TaskID server_task_id = WorkerThreadPool::INVALID_TASK_ID;
|
||||
bool exit = false;
|
||||
bool create_thread = false;
|
||||
SafeFlag doing_sync;
|
||||
|
||||
void _assign_mt_ids(WorkerThreadPool::TaskID p_pump_task_id);
|
||||
void _thread_exit();
|
||||
void _thread_loop();
|
||||
void _thread_sync();
|
||||
|
||||
public:
|
||||
#define ServerName PhysicsServer2D
|
||||
|
||||
Reference in New Issue
Block a user