Skip to content

Commit

Permalink
Move notification out of block locking associated mutex in Gravity.cpp
Browse files Browse the repository at this point in the history
I don't know how it ended up inside, I wanted it outside. For the record,
signalling the CV while the associated mutex is locked is a pessimisation,
it just yields predictable scheduling.
  • Loading branch information
LBPHacker committed Apr 17, 2019
1 parent 5810a19 commit e1d32c9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/simulation/Gravity.cpp
Expand Up @@ -125,11 +125,11 @@ void Gravity::gravity_update_async()
signal_grav = true;
}
}
}

if (signal_grav)
{
gravcv.notify_one();
}
if (signal_grav)
{
gravcv.notify_one();
}
//Apply the gravity mask
membwand(gravy, gravmask, (XRES/CELL)*(YRES/CELL)*sizeof(float), (XRES/CELL)*(YRES/CELL)*sizeof(unsigned));
Expand Down

0 comments on commit e1d32c9

Please sign in to comment.