aboutsummaryrefslogtreecommitdiff
path: root/include/Window.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-01-12 20:39:23 +0100
committerdec05eba <dec05eba@protonmail.com>2019-01-12 20:39:26 +0100
commitdaa59b89b1f05cf3a2abdee9ef5ac8bffe805b13 (patch)
tree4b027770beec143d9e514819b6ca30d4a9695eab /include/Window.hpp
parentfe4199dace73ee38262528f7ae88cbfba99120dd (diff)
Fix multithreading crashes
Diffstat (limited to 'include/Window.hpp')
-rw-r--r--include/Window.hpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/Window.hpp b/include/Window.hpp
index 645b578..b33605b 100644
--- a/include/Window.hpp
+++ b/include/Window.hpp
@@ -10,6 +10,7 @@
#include <mutex>
#include <random>
#include <vector>
+#include <future>
#include <glibmm/dispatcher.h>
namespace dchat
@@ -33,6 +34,7 @@ namespace dchat
void draw(const Cairo::RefPtr<Cairo::Context> &cairo) { Gtk::Overlay::draw(cairo); }
};
+ std::thread::id mainThreadId;
std::mutex databaseCallbackMutex;
OverlayDrawable overlay;
Gtk::Stack stack;
@@ -58,7 +60,7 @@ namespace dchat
sigc::connection drawBackgroundConnection;
Glib::Dispatcher dispatcher;
- std::mutex dispatcherMutex;
+ std::recursive_mutex dispatcherMutex;
std::vector<DispatcherHandler> dispatcherHandlers;
};
-} \ No newline at end of file
+}