mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2025-05-06 17:51:36 +02:00
Added a mutex class.
This commit is contained in:
parent
ec65de456d
commit
c94c465d78
@ -13,6 +13,7 @@ env.add_source_files(env.core_sources, "./hash/*.cpp")
|
|||||||
env.add_source_files(env.core_sources, "./bry_http/*.cpp")
|
env.add_source_files(env.core_sources, "./bry_http/*.cpp")
|
||||||
env.add_source_files(env.core_sources, "./database/*.cpp")
|
env.add_source_files(env.core_sources, "./database/*.cpp")
|
||||||
env.add_source_files(env.core_sources, "./os/*.cpp")
|
env.add_source_files(env.core_sources, "./os/*.cpp")
|
||||||
|
env.add_source_files(env.core_sources, "./threading/*.cpp")
|
||||||
|
|
||||||
# Build it all as a library
|
# Build it all as a library
|
||||||
lib = env.add_library("core", env.core_sources)
|
lib = env.add_library("core", env.core_sources)
|
||||||
|
15
core/threading/mutex.cpp
Normal file
15
core/threading/mutex.cpp
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#include "mutex.h"
|
||||||
|
|
||||||
|
void Mutex::lock() {
|
||||||
|
_mutex.lock();
|
||||||
|
}
|
||||||
|
void Mutex::unlock() {
|
||||||
|
_mutex.unlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
Mutex::Mutex() {
|
||||||
|
|
||||||
|
}
|
||||||
|
Mutex::~Mutex() {
|
||||||
|
|
||||||
|
}
|
19
core/threading/mutex.h
Normal file
19
core/threading/mutex.h
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#ifndef MUTEX_H
|
||||||
|
#define MUTEX_H
|
||||||
|
|
||||||
|
#include <mutex>
|
||||||
|
|
||||||
|
class Mutex {
|
||||||
|
public:
|
||||||
|
void lock();
|
||||||
|
void unlock();
|
||||||
|
|
||||||
|
Mutex();
|
||||||
|
virtual ~Mutex();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
std::mutex _mutex;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue
Block a user