[Scummvm-git-logs] scummvm master -> ac596de9697c4465f6b36b987289da9f29428dca

sev- sev at scummvm.org
Sat Jun 19 12:19:11 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
ac596de969 AUDIO: Add missing mutex lock to isReady()


Commit: ac596de9697c4465f6b36b987289da9f29428dca
    https://github.com/scummvm/scummvm/commit/ac596de9697c4465f6b36b987289da9f29428dca
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2021-06-19T14:19:09+02:00

Commit Message:
AUDIO: Add missing mutex lock to isReady()

At least it seems to me that the way e.g. Lure of the Temptress calls
isReady() to see if the driver has finished processing all the custom
sounds, _sysExQueue can be accessed by two threads simultaneously.

Which seems like a bad thing to me!

Changed paths:
    audio/mt32gm.h


diff --git a/audio/mt32gm.h b/audio/mt32gm.h
index 0e8dbee714..a3bf74490e 100644
--- a/audio/mt32gm.h
+++ b/audio/mt32gm.h
@@ -298,7 +298,10 @@ public:
 	virtual int open(MidiDriver *driver, bool nativeMT32);
 	void close() override;
 	bool isOpen() const override { return _isOpen; }
-	bool isReady() override { return _sysExQueue.empty(); }
+	bool isReady() override {
+		Common::StackLock lock(_sysExQueueMutex);
+		return _sysExQueue.empty();
+	}
 	uint32 property(int prop, uint32 param) override;
 
 	using MidiDriver_BASE::send;




More information about the Scummvm-git-logs mailing list