/
dieoska
/
ddnet
Обзор
Документация
Войти
/
dieoska
/
ddnet
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
src/engine/server/server_logger.h
23 строки
526 B
Robert Müller
Use `CLock` instead of `std::mutex`, add thread-safety annotations
11 ноя 2023, 02:09
11 ноя 2023, 02:09
1047004
Код
Авторство
О чём код?
#ifndef ENGINE_SERVER_SERVER_LOGGER_H #define ENGINE_SERVER_SERVER_LOGGER_H #include <base/logger.h> #include <thread> class CServer; class CServerLogger : public ILogger { CServer *m_pServer = nullptr; CLock m_PendingLock; std::vector<CLogMessage> m_vPending; std::thread::id m_MainThread; public: CServerLogger(CServer *pServer); void Log(const CLogMessage *pMessage) override REQUIRES(!m_PendingLock); // Must be called from the main thread! void OnServerDeletion(); }; #endif // ENGINE_SERVER_SERVER_LOGGER_H