aboutsummaryrefslogtreecommitdiff
path: root/servers/physics_2d/physics_2d_server_wrap_mt.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--servers/physics_2d/physics_2d_server_wrap_mt.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/servers/physics_2d/physics_2d_server_wrap_mt.cpp b/servers/physics_2d/physics_2d_server_wrap_mt.cpp
index 0ee78afba..c5f023f16 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;
}