mirror of
https://github.com/hyprwm/hyprlock.git
synced 2025-01-24 19:39:49 +01:00
DBusManager: Remove unnecessary locks from getters in singleton
This commit is contained in:
parent
00b02c005f
commit
b22009f992
2 changed files with 0 additions and 8 deletions
|
@ -33,12 +33,10 @@ void DBusManager::initializeConnection() {
|
|||
}
|
||||
|
||||
std::shared_ptr<sdbus::IConnection> DBusManager::getConnection() {
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
return m_pConnection;
|
||||
}
|
||||
|
||||
std::shared_ptr<sdbus::IProxy> DBusManager::getLoginProxy() {
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
if (!m_pLoginProxy)
|
||||
initializeConnection();
|
||||
|
||||
|
@ -46,7 +44,6 @@ std::shared_ptr<sdbus::IProxy> DBusManager::getLoginProxy() {
|
|||
}
|
||||
|
||||
std::shared_ptr<sdbus::IProxy> DBusManager::getSessionProxy() {
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
if (!m_pSessionProxy)
|
||||
initializeConnection();
|
||||
|
||||
|
@ -54,7 +51,6 @@ std::shared_ptr<sdbus::IProxy> DBusManager::getSessionProxy() {
|
|||
}
|
||||
|
||||
void DBusManager::setLockedHint(bool locked) {
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
if (!m_pSessionProxy) {
|
||||
Debug::log(WARN, "[DBusManager] Cannot set locked hint: Proxy is not initialized.");
|
||||
return;
|
||||
|
@ -71,7 +67,6 @@ void DBusManager::setLockedHint(bool locked) {
|
|||
}
|
||||
|
||||
void DBusManager::sendUnlockSignal() {
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
if (!m_pSessionProxy) {
|
||||
Debug::log(WARN, "[DBusManager] Unlock signal skipped: Proxy is not initialized.");
|
||||
return;
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <mutex>
|
||||
#include <sdbus-c++/sdbus-c++.h>
|
||||
|
||||
class DBusManager {
|
||||
|
@ -25,6 +24,4 @@ private:
|
|||
std::shared_ptr<sdbus::IConnection> m_pConnection;
|
||||
std::shared_ptr<sdbus::IProxy> m_pLoginProxy;
|
||||
std::shared_ptr<sdbus::IProxy> m_pSessionProxy;
|
||||
|
||||
std::mutex m_mutex;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue