Use AUTOLOCK macro (#660)

* Use AUTOLOCK macro

* MxAutoLock

* Remove semicolon

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>

---------

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
This commit is contained in:
MS
2024-03-12 10:23:50 -04:00
committed by GitHub
parent b0483000d8
commit e3d7188ec9
28 changed files with 127 additions and 125 deletions

View File

@@ -1,6 +1,6 @@
#include "legosoundmanager.h"
#include "mxautolocker.h"
#include "mxautolock.h"
#include "mxomni.h"
// FUNCTION: LEGO1 0x100298a0
@@ -90,6 +90,6 @@ MxResult LegoSoundManager::Tickle()
{
MxSoundManager::Tickle();
MxAutoLocker lock(&m_criticalSection);
AUTOLOCK(m_criticalSection);
return m_unk0x40->Tickle();
}

View File

@@ -3,7 +3,7 @@
#include "legosoundmanager.h"
#include "legovideomanager.h"
#include "misc.h"
#include "mxautolocker.h"
#include "mxautolock.h"
#include "mxdsmultiaction.h"
#include "mxmediapresenter.h"
#include "mxmisc.h"
@@ -29,7 +29,7 @@ MxCompositeMediaPresenter::~MxCompositeMediaPresenter()
// FUNCTION: LEGO1 0x10074090
MxResult MxCompositeMediaPresenter::StartAction(MxStreamController* p_controller, MxDSAction* p_action)
{
MxAutoLocker lock(&m_criticalSection);
AUTOLOCK(m_criticalSection);
MxResult result = FAILURE;
MxDSActionList* actions = ((MxDSMultiAction*) p_action)->GetActionList();
@@ -96,7 +96,7 @@ MxResult MxCompositeMediaPresenter::StartAction(MxStreamController* p_controller
// FUNCTION: LEGO1 0x100742e0
void MxCompositeMediaPresenter::StartingTickle()
{
MxAutoLocker lock(&m_criticalSection);
AUTOLOCK(m_criticalSection);
if (!m_unk0x4e) {
for (MxCompositePresenterList::iterator it = m_list.begin(); it != m_list.end(); it++) {
@@ -142,7 +142,7 @@ void MxCompositeMediaPresenter::StartingTickle()
// FUNCTION: LEGO1 0x10074470
MxResult MxCompositeMediaPresenter::Tickle()
{
MxAutoLocker lock(&m_criticalSection);
AUTOLOCK(m_criticalSection);
switch (m_currentTickleState) {
case e_ready:
@@ -169,7 +169,7 @@ MxResult MxCompositeMediaPresenter::Tickle()
// FUNCTION: LEGO1 0x10074540
MxResult MxCompositeMediaPresenter::PutData()
{
MxAutoLocker lock(&m_criticalSection);
AUTOLOCK(m_criticalSection);
if (m_currentTickleState >= e_streaming && m_currentTickleState <= e_done) {
for (MxCompositePresenterList::iterator it = m_list.begin(); it != m_list.end(); it++) {

View File

@@ -15,7 +15,7 @@
#include "misc.h"
#include "modeldb/modeldb.h"
#include "mxactionnotificationparam.h"
#include "mxautolocker.h"
#include "mxautolock.h"
#include "mxdsactionlist.h"
#include "mxdschunk.h"
#include "mxdsmediaaction.h"
@@ -78,7 +78,7 @@ LegoWorldPresenter::~LegoWorldPresenter()
// FUNCTION: LEGO1 0x10066870
MxResult LegoWorldPresenter::StartAction(MxStreamController* p_controller, MxDSAction* p_action)
{
MxAutoLocker lock(&m_criticalSection);
AUTOLOCK(m_criticalSection);
MxResult result = FAILURE;
MxDSActionList* actions = ((MxDSMultiAction*) p_action)->GetActionList();

View File

@@ -4,7 +4,7 @@
#include "legoomni.h"
#include "legovideomanager.h"
#include "misc.h"
#include "mxautolocker.h"
#include "mxautolock.h"
#include "roi/legoroi.h"
DECOMP_SIZE_ASSERT(LegoInputManager, 0x338)
@@ -224,7 +224,7 @@ MxResult LegoInputManager::GetJoystickState(
// FUNCTION: LEGO1 0x1005c470
void LegoInputManager::Register(MxCore* p_notify)
{
MxAutoLocker lock(&m_criticalSection);
AUTOLOCK(m_criticalSection);
LegoNotifyListCursor cursor(m_keyboardNotifyList);
if (!cursor.Find(p_notify)) {
@@ -235,7 +235,7 @@ void LegoInputManager::Register(MxCore* p_notify)
// FUNCTION: LEGO1 0x1005c5c0
void LegoInputManager::UnRegister(MxCore* p_notify)
{
MxAutoLocker lock(&m_criticalSection);
AUTOLOCK(m_criticalSection);
LegoNotifyListCursor cursor(m_keyboardNotifyList);
if (cursor.Find(p_notify)) {
@@ -281,7 +281,7 @@ void LegoInputManager::QueueEvent(NotificationId p_id, MxU8 p_modifier, MxLong p
// FUNCTION: LEGO1 0x1005c820
void LegoInputManager::ProcessEvents()
{
MxAutoLocker lock(&m_criticalSection);
AUTOLOCK(m_criticalSection);
LegoEventNotificationParam event;
while (m_eventQueue->Dequeue(event)) {

View File

@@ -16,7 +16,7 @@
#include "misc.h"
#include "misc/legocontainer.h"
#include "mxactionnotificationparam.h"
#include "mxautolocker.h"
#include "mxautolock.h"
#include "mxbackgroundaudiomanager.h"
#include "mxdsfile.h"
#include "mxmisc.h"
@@ -309,7 +309,7 @@ void LegoOmni::Init()
// FUNCTION: LEGO1 0x10058c30
void LegoOmni::Destroy()
{
MxAutoLocker lock(&this->m_criticalsection);
AUTOLOCK(m_criticalSection);
m_notificationManager->Unregister(this);
@@ -389,7 +389,7 @@ void LegoOmni::Destroy()
MxResult LegoOmni::Create(MxOmniCreateParam& p_param)
{
MxResult result = FAILURE;
MxAutoLocker lock(&this->m_criticalsection);
AUTOLOCK(m_criticalSection);
p_param.CreateFlags().CreateObjectFactory(FALSE);
p_param.CreateFlags().CreateVideoManager(FALSE);

View File

@@ -2,7 +2,7 @@
#include "legovideomanager.h"
#include "misc.h"
#include "mxautolocker.h"
#include "mxautolock.h"
DECOMP_SIZE_ASSERT(LegoPathPresenter, 0x54);
@@ -44,7 +44,7 @@ void LegoPathPresenter::Destroy(MxBool p_fromDestructor)
}
{
MxAutoLocker lock(&this->m_criticalSection);
AUTOLOCK(m_criticalSection);
Init();
}