# HG changeset patch # User Matti Hamalainen # Date 1349960474 -10800 # Node ID bc2e8ce003d7baadc83fe2d987b0823a95c0c64a # Parent 43312a36811f22f3e4f0b0a15ca3d1a3a9470c52 Improve locking. diff -r 43312a36811f -r bc2e8ce003d7 ppl.c --- a/ppl.c Thu Oct 11 16:00:55 2012 +0300 +++ b/ppl.c Thu Oct 11 16:01:14 2012 +0300 @@ -843,6 +843,8 @@ JSS_LOCK(engine.plr); JSSPattern *currPattern = engine.plr->pattern; int currRow = engine.plr->row; + if (!engine.plr->isPlaying) + engine.exitFlag = TRUE; JSS_UNLOCK(engine.plr); if (currRow != prevRow || force) @@ -879,14 +881,8 @@ if (force || currTick - prevTick >= (engine.pauseFlag ? 100 : 20)) { JSS_LOCK(engine.dev); - JSS_LOCK(engine.plr); dmDisplayChannels(engine.screen, 5, engine.screen->h * 0.8 + 5, engine.screen->w - 5, engine.screen->h - 5, engine.dev); - - if (!engine.plr->isPlaying) - engine.exitFlag = TRUE; - - JSS_UNLOCK(engine.plr); JSS_UNLOCK(engine.dev); }