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,7 +1,7 @@
#include "mxcompositepresenter.h"
#include "decomp.h"
#include "mxautolocker.h"
#include "mxautolock.h"
#include "mxdsmultiaction.h"
#include "mxmisc.h"
#include "mxnotificationmanager.h"
@@ -24,7 +24,7 @@ MxCompositePresenter::~MxCompositePresenter()
// FUNCTION: LEGO1 0x100b6410
MxResult MxCompositePresenter::StartAction(MxStreamController* p_controller, MxDSAction* p_action)
{
MxAutoLocker lock(&m_criticalSection);
AUTOLOCK(m_criticalSection);
MxResult result = FAILURE;
MxDSActionList* actions = ((MxDSMultiAction*) p_action)->GetActionList();
@@ -77,7 +77,7 @@ MxResult MxCompositePresenter::StartAction(MxStreamController* p_controller, MxD
// FUNCTION: LEGO1 0x100b65e0
void MxCompositePresenter::EndAction()
{
MxAutoLocker lock(&m_criticalSection);
AUTOLOCK(m_criticalSection);
if (!m_action) {
return;
@@ -113,7 +113,7 @@ void MxCompositePresenter::EndAction()
// FUNCTION: LEGO1 0x100b6760
MxLong MxCompositePresenter::Notify(MxParam& p_param)
{
MxAutoLocker lock(&m_criticalSection);
AUTOLOCK(m_criticalSection);
switch (((MxNotificationParam&) p_param).GetNotification()) {
case c_notificationEndAction:

View File

@@ -1,7 +1,7 @@
#include "mxmediamanager.h"
#include "decomp.h"
#include "mxautolocker.h"
#include "mxautolock.h"
#include "mxomni.h"
#include "mxpresenter.h"
#include "mxticklemanager.h"
@@ -33,7 +33,7 @@ MxResult MxMediaManager::Init()
// FUNCTION: LEGO1 0x100b85e0
MxResult MxMediaManager::InitPresenters()
{
MxAutoLocker lock(&this->m_criticalSection);
AUTOLOCK(m_criticalSection);
this->m_presenters = new MxPresenterList;
@@ -48,7 +48,7 @@ MxResult MxMediaManager::InitPresenters()
// FUNCTION: LEGO1 0x100b8710
void MxMediaManager::Destroy()
{
MxAutoLocker lock(&this->m_criticalSection);
AUTOLOCK(m_criticalSection);
if (this->m_presenters) {
delete this->m_presenters;
@@ -60,7 +60,7 @@ void MxMediaManager::Destroy()
// FUNCTION: LEGO1 0x100b8790
MxResult MxMediaManager::Tickle()
{
MxAutoLocker lock(&this->m_criticalSection);
AUTOLOCK(m_criticalSection);
MxPresenter* presenter;
MxPresenterListCursor cursor(this->m_presenters);
@@ -80,7 +80,7 @@ MxResult MxMediaManager::Tickle()
// FUNCTION: LEGO1 0x100b88c0
void MxMediaManager::RegisterPresenter(MxPresenter& p_presenter)
{
MxAutoLocker lock(&this->m_criticalSection);
AUTOLOCK(m_criticalSection);
this->m_presenters->Append(&p_presenter);
}
@@ -88,7 +88,7 @@ void MxMediaManager::RegisterPresenter(MxPresenter& p_presenter)
// FUNCTION: LEGO1 0x100b8980
void MxMediaManager::UnregisterPresenter(MxPresenter& p_presenter)
{
MxAutoLocker lock(&this->m_criticalSection);
AUTOLOCK(m_criticalSection);
MxPresenterListCursor cursor(this->m_presenters);
if (cursor.Find(&p_presenter)) {
@@ -99,7 +99,7 @@ void MxMediaManager::UnregisterPresenter(MxPresenter& p_presenter)
// FUNCTION: LEGO1 0x100b8ac0
void MxMediaManager::StopPresenters()
{
MxAutoLocker lock(&this->m_criticalSection);
AUTOLOCK(m_criticalSection);
MxPresenter* presenter;
MxPresenterListCursor cursor(this->m_presenters);

View File

@@ -1,7 +1,7 @@
#include "mxmediapresenter.h"
#include "mxactionnotificationparam.h"
#include "mxautolocker.h"
#include "mxautolock.h"
#include "mxcompositepresenter.h"
#include "mxmisc.h"
#include "mxnotificationmanager.h"
@@ -25,7 +25,7 @@ void MxMediaPresenter::Init()
void MxMediaPresenter::Destroy(MxBool p_fromDestructor)
{
{
MxAutoLocker lock(&m_criticalSection);
AUTOLOCK(m_criticalSection);
if (m_currentChunk && m_subscriber) {
m_subscriber->FreeDataChunk(m_currentChunk);
@@ -101,7 +101,7 @@ MxStreamChunk* MxMediaPresenter::NextChunk()
MxResult MxMediaPresenter::StartAction(MxStreamController* p_controller, MxDSAction* p_action)
{
MxResult result = FAILURE;
MxAutoLocker lock(&m_criticalSection);
AUTOLOCK(m_criticalSection);
if (MxPresenter::StartAction(p_controller, p_action) == SUCCESS) {
if (m_action->GetFlags() & MxDSAction::c_looping) {
@@ -132,7 +132,7 @@ done:
// FUNCTION: LEGO1 0x100b5bc0
void MxMediaPresenter::EndAction()
{
MxAutoLocker lock(&m_criticalSection);
AUTOLOCK(m_criticalSection);
if (!m_action) {
return;
@@ -172,7 +172,7 @@ void MxMediaPresenter::EndAction()
// FUNCTION: LEGO1 0x100b5d10
MxResult MxMediaPresenter::Tickle()
{
MxAutoLocker lock(&m_criticalSection);
AUTOLOCK(m_criticalSection);
CurrentChunk();

View File

@@ -3,7 +3,7 @@
#include "decomp.h"
#include "define.h"
#include "mxactionnotificationparam.h"
#include "mxautolocker.h"
#include "mxautolock.h"
#include "mxcompositepresenter.h"
#include "mxdsanim.h"
#include "mxdssound.h"
@@ -34,7 +34,7 @@ void MxPresenter::Init()
// FUNCTION: LEGO1 0x100b4d80
MxResult MxPresenter::StartAction(MxStreamController*, MxDSAction* p_action)
{
MxAutoLocker lock(&this->m_criticalSection);
AUTOLOCK(m_criticalSection);
this->m_action = p_action;
@@ -55,7 +55,7 @@ void MxPresenter::EndAction()
return;
}
MxAutoLocker lock(&this->m_criticalSection);
AUTOLOCK(m_criticalSection);
if (!this->m_compositePresenter) {
#ifdef COMPAT_MODE
@@ -79,7 +79,7 @@ void MxPresenter::EndAction()
// FUNCTION: LEGO1 0x100b4fc0
void MxPresenter::ParseExtra()
{
MxAutoLocker lock(&m_criticalSection);
AUTOLOCK(m_criticalSection);
MxU16 extraLength;
char* extraData;
@@ -113,7 +113,7 @@ void MxPresenter::ParseExtra()
void MxPresenter::SendToCompositePresenter(MxOmni* p_omni)
{
if (m_compositePresenter) {
MxAutoLocker lock(&m_criticalSection);
AUTOLOCK(m_criticalSection);
#ifdef COMPAT_MODE
{
@@ -132,7 +132,7 @@ void MxPresenter::SendToCompositePresenter(MxOmni* p_omni)
// FUNCTION: LEGO1 0x100b5200
MxResult MxPresenter::Tickle()
{
MxAutoLocker lock(&this->m_criticalSection);
AUTOLOCK(m_criticalSection);
switch (this->m_currentTickleState) {
case e_ready: