From b1b7826ea7e04a3eb4d9b3d011e9a2a8dff5db03 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 26 May 2015 01:30:36 -0300 Subject: oops, previous commit was not working it is working now --- servers/physics_2d/physics_2d_server_wrap_mt.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'servers/physics_2d/physics_2d_server_wrap_mt.cpp') diff --git a/servers/physics_2d/physics_2d_server_wrap_mt.cpp b/servers/physics_2d/physics_2d_server_wrap_mt.cpp index 0ee78afbaa..c5f023f162 100644 --- a/servers/physics_2d/physics_2d_server_wrap_mt.cpp +++ b/servers/physics_2d/physics_2d_server_wrap_mt.cpp @@ -61,7 +61,12 @@ void Physics2DServerWrapMT::step(float p_step) { void Physics2DServerWrapMT::sync() { - step_sem->wait(); + if (step_sem) { + if (first_frame) + first_frame=false; + else + step_sem->wait(); //must not wait if a step was not issued + } physics_2d_server->sync();; } @@ -147,6 +152,9 @@ Physics2DServerWrapMT::Physics2DServerWrapMT(Physics2DServer* p_contained,bool p } else { server_thread=0; } + + main_thread = Thread::get_caller_ID(); + first_frame=true; } -- cgit v1.2.3