mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-11 02:28:18 +00:00
ef174a58a8
src/engine/client/serverbrowser_http.cpp:147:1: warning: mutex 'ls.m_Lock' is still held at the end of function [-Wthread-safety-analysis] } ^
25 lines
315 B
C++
25 lines
315 B
C++
#ifndef BASE_LOCK_SCOPE_H
|
|
#define BASE_LOCK_SCOPE_H
|
|
|
|
#include "system.h"
|
|
|
|
class SCOPED_CAPABILITY CLockScope
|
|
{
|
|
public:
|
|
CLockScope(LOCK Lock) ACQUIRE(Lock, m_Lock) :
|
|
m_Lock(Lock)
|
|
{
|
|
lock_wait(m_Lock);
|
|
}
|
|
|
|
~CLockScope() RELEASE() REQUIRES(m_Lock)
|
|
{
|
|
lock_unlock(m_Lock);
|
|
}
|
|
|
|
private:
|
|
LOCK m_Lock;
|
|
};
|
|
|
|
#endif
|