SAGA: Add comments about possibly race conditions to timer callbacks.

(cherry picked from commit 93f627441ac68e7a4c3e7f748a7b6f999bd9c96a)
This commit is contained in:
Johannes Schickel 2016-02-09 02:51:42 +01:00
parent a5b9df120d
commit 01020089da
4 changed files with 12 additions and 0 deletions

View File

@ -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();

View File

@ -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;

View File

@ -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);

View File

@ -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;
}