This commit is contained in:
Elias Vanderstuyft 2016-08-22 10:39:54 +00:00 committed by GitHub
commit 95cc98f165

View File

@ -457,7 +457,12 @@ static void draw_particles(GLFWwindow* window, double t, float dt)
{
struct timespec ts;
clock_gettime(CLOCK_REALTIME, &ts);
ts.tv_nsec += 100000000;
ts.tv_nsec += 100 * 1000 * 1000;
if (ts.tv_nsec >= 1000 * 1000 * 1000)
{
ts.tv_sec++;
ts.tv_nsec -= 1000 * 1000 * 1000;
}
cnd_timedwait(&thread_sync.p_done, &thread_sync.particles_lock, &ts);
}
@ -908,7 +913,12 @@ static int physics_thread_main(void* arg)
{
struct timespec ts;
clock_gettime(CLOCK_REALTIME, &ts);
ts.tv_nsec += 100000000;
ts.tv_nsec += 100 * 1000 * 1000;
if (ts.tv_nsec >= 1000 * 1000 * 1000)
{
ts.tv_sec++;
ts.tv_nsec -= 1000 * 1000 * 1000;
}
cnd_timedwait(&thread_sync.d_done, &thread_sync.particles_lock, &ts);
}