refactor: XMT Classes => MTException Classes

This commit is contained in:
sithlord48
2025-08-07 16:57:23 -04:00
committed by Nick Bolton
parent ada2813f9f
commit 22a358fb49
4 changed files with 15 additions and 13 deletions

View File

@ -8,12 +8,12 @@ add_library(mt STATIC
CondVar.h
Lock.cpp
Lock.h
MTException.cpp
MTException.h
Mutex.cpp
Mutex.h
Thread.cpp
Thread.h
XMT.cpp
XMT.h
XThread.h
)

View File

@ -1,17 +1,18 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
*/
#include "XMT.h"
#include "MTException.h"
//
// XMTThreadUnavailable
// MTThreadUnavailableException
//
std::string XMTThreadUnavailable::getWhat() const throw()
std::string MTThreadUnavailableException::getWhat() const throw()
{
return format("XMTThreadUnavailable", "cannot create thread");
return format("MTThreadUnavailableException", "cannot create thread");
}

View File

@ -1,5 +1,6 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2025 Deskflow Developers
* SPDX-FileCopyrightText: (C) 2012 - 2016 Symless Ltd.
* SPDX-FileCopyrightText: (C) 2002 Chris Schoeneman
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
@ -10,19 +11,19 @@
#include "base/XBase.h"
/**
* @brief XMT generic multithreading exception
* @brief MTException generic multithreading exception
*/
class XMT : public XBase
class MTException : public XBase
{
using XBase::XBase;
};
/**
* @brief XMTThreadUnavailable - Thrown when a thread cannot be created.
* @brief MTThreadUnavailableException - Thrown when a thread cannot be created.
*/
class XMTThreadUnavailable : public XMT
class MTThreadUnavailableException : public MTException
{
using XMT::XMT;
using MTException::MTException;
protected:
std::string getWhat() const throw() override;

View File

@ -10,7 +10,7 @@
#include "arch/Arch.h"
#include "base/IJob.h"
#include "base/Log.h"
#include "mt/XMT.h"
#include "mt/MTException.h"
#include "mt/XThread.h"
#include <exception>
@ -24,7 +24,7 @@ Thread::Thread(IJob *job)
if (m_thread == nullptr) {
// couldn't create thread
delete job;
throw XMTThreadUnavailable();
throw MTThreadUnavailableException();
}
}