Skip to content

Commit

Permalink
Heaven: Fix race condition when accessing Time while RenderThread is …
Browse files Browse the repository at this point in the history
…starting

Fixes #395.
  • Loading branch information
mat1jaczyyy committed Sep 25, 2020
1 parent dc9131f commit a4ead3e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Apollo/Rendering/Heaven.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ public static double Time {
static void Wake() {
if (RenderThread?.IsCompleted == false) return;

prev = Program.TimeSpent.ElapsedTicks - 1;

RenderThread = Task.Run(() => {
prev = Program.TimeSpent.ElapsedTicks - 1;

Expand Down

0 comments on commit a4ead3e

Please sign in to comment.