Skip to content
Snippets Groups Projects
Commit c7490040 authored by Tobias Frisch's avatar Tobias Frisch
Browse files

[#79] Breaking some commandments for MinGW

parent 52fd6e51
No related branches found
No related tags found
1 merge request!80Resolve "MinGW corrections for the hacks"
#pragma once #pragma once
#include <functional> #include <functional>
#ifndef __MINGW32__
#include <mutex> #include <mutex>
#endif
namespace vkcv { namespace vkcv {
...@@ -27,7 +30,10 @@ namespace vkcv { ...@@ -27,7 +30,10 @@ namespace vkcv {
private: private:
std::vector< event_function<T...> > m_functions; std::vector< event_function<T...> > m_functions;
uint32_t m_id_counter; uint32_t m_id_counter;
#ifndef __MINGW32__
std::mutex m_mutex; std::mutex m_mutex;
#endif
public: public:
...@@ -75,14 +81,18 @@ namespace vkcv { ...@@ -75,14 +81,18 @@ namespace vkcv {
* locks the event so its function handles won't be called * locks the event so its function handles won't be called
*/ */
void lock() { void lock() {
#ifndef __MINGW32__
m_mutex.lock(); m_mutex.lock();
#endif
} }
/** /**
* unlocks the event so its function handles can be called after locking * unlocks the event so its function handles can be called after locking
*/ */
void unlock() { void unlock() {
#ifndef __MINGW32__
m_mutex.unlock(); m_mutex.unlock();
#endif
} }
explicit event(bool locked = false) { explicit event(bool locked = false) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment