aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2016-02-09 02:51:42 +0100
committerJohannes Schickel2016-02-09 02:52:29 +0100
commit01020089da07451336548dcaeb9365a3086911b8 (patch)
tree1ca4b4ac0f7651bfb2a5429ca70b254332ae0a8f
parenta5b9df120d135a280a68eba1b2f5a88bca247724 (diff)
downloadscummvm-rg350-01020089da07451336548dcaeb9365a3086911b8.tar.gz
scummvm-rg350-01020089da07451336548dcaeb9365a3086911b8.tar.bz2
scummvm-rg350-01020089da07451336548dcaeb9365a3086911b8.zip
SAGA: Add comments about possibly race conditions to timer callbacks.
(cherry picked from commit 93f627441ac68e7a4c3e7f748a7b6f999bd9c96a)
-rw-r--r--engines/saga/interface.cpp3
-rw-r--r--engines/saga/music.cpp3
-rw-r--r--engines/saga/puzzle.cpp3
-rw-r--r--engines/saga/render.cpp3
4 files changed, 12 insertions, 0 deletions
diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp
index 44581f26fc..cb42ac0aaa 100644
--- a/engines/saga/interface.cpp
+++ b/engines/saga/interface.cpp
@@ -332,6 +332,9 @@ void Interface::saveReminderCallback(void *refCon) {
}
void Interface::updateSaveReminder() {
+ // CHECKME: This is potentially called from a different thread because it is
+ // called from a timer callback. However, it does not seem to take any
+ // precautions to avoid race conditions.
if (_active && _panelMode == kPanelMain) {
_saveReminderState = _saveReminderState % _vm->getDisplayInfo().saveReminderNumSprites + 1;
drawStatusBar();
diff --git a/engines/saga/music.cpp b/engines/saga/music.cpp
index 663f5991d0..cd48ebaa4d 100644
--- a/engines/saga/music.cpp
+++ b/engines/saga/music.cpp
@@ -224,6 +224,9 @@ void Music::musicVolumeGaugeCallback(void *refCon) {
}
void Music::musicVolumeGauge() {
+ // CHECKME: This is potentially called from a different thread because it is
+ // called from a timer callback. However, it does not seem to take any
+ // precautions to avoid race conditions.
int volume;
_currentVolumePercent += 10;
diff --git a/engines/saga/puzzle.cpp b/engines/saga/puzzle.cpp
index 705834f1b7..099bf79e6b 100644
--- a/engines/saga/puzzle.cpp
+++ b/engines/saga/puzzle.cpp
@@ -399,6 +399,9 @@ void Puzzle::hintTimerCallback(void *refCon) {
}
void Puzzle::solicitHint() {
+ // CHECKME: This is potentially called from a different thread because it is
+ // called from a timer callback. However, it does not seem to take any
+ // precautions to avoid race conditions.
int i;
_vm->_actor->setSpeechColor(1, kITEColorBlack);
diff --git a/engines/saga/render.cpp b/engines/saga/render.cpp
index 1f23a388d0..b932e228ad 100644
--- a/engines/saga/render.cpp
+++ b/engines/saga/render.cpp
@@ -276,6 +276,9 @@ void Render::fpsTimerCallback(void *refCon) {
}
void Render::fpsTimer() {
+ // CHECKME: This is potentially called from a different thread because it is
+ // called from a timer callback. However, it does not seem to take any
+ // precautions to avoid race conditions.
_fps = _renderedFrameCount;
_renderedFrameCount = 0;
}