diff --git a/core/SCsub b/core/SCsub index b96a1e1..290329e 100644 --- a/core/SCsub +++ b/core/SCsub @@ -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, "./database/*.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 lib = env.add_library("core", env.core_sources) diff --git a/core/threading/mutex.cpp b/core/threading/mutex.cpp new file mode 100644 index 0000000..b63be1c --- /dev/null +++ b/core/threading/mutex.cpp @@ -0,0 +1,15 @@ +#include "mutex.h" + +void Mutex::lock() { + _mutex.lock(); +} +void Mutex::unlock() { + _mutex.unlock(); +} + +Mutex::Mutex() { + +} +Mutex::~Mutex() { + +} \ No newline at end of file diff --git a/core/threading/mutex.h b/core/threading/mutex.h new file mode 100644 index 0000000..f80aaa4 --- /dev/null +++ b/core/threading/mutex.h @@ -0,0 +1,19 @@ +#ifndef MUTEX_H +#define MUTEX_H + +#include + +class Mutex { +public: + void lock(); + void unlock(); + + Mutex(); + virtual ~Mutex(); + +protected: + std::mutex _mutex; +}; + + +#endif \ No newline at end of file