[gnote] Replace Glib thread with std::thread in SyncManager



commit cb4813034cfb223f7be020e8fa590fee16714320
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Sun May 2 21:46:25 2021 +0300

    Replace Glib thread with std::thread in SyncManager

 src/synchronization/syncmanager.cpp | 5 +++--
 src/synchronization/syncmanager.hpp | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/synchronization/syncmanager.cpp b/src/synchronization/syncmanager.cpp
index 60300cfd..ea72f7b6 100644
--- a/src/synchronization/syncmanager.cpp
+++ b/src/synchronization/syncmanager.cpp
@@ -1,7 +1,7 @@
 /*
  * gnote
  *
- * Copyright (C) 2012-2014,2017,2019-2020 Aurimas Cernius
+ * Copyright (C) 2012-2014,2017,2019-2021 Aurimas Cernius
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -120,7 +120,8 @@ namespace sync {
 
     m_sync_ui = sync_ui;
     DBG_OUT("Creating synchronization thread");
-    m_sync_thread = Glib::Thread::create(sigc::mem_fun(*this, &SyncManager::synchronization_thread), false);
+    m_sync_thread = new std::thread([this] { synchronization_thread(); });
+    m_sync_thread->detach();
   }
 
 
diff --git a/src/synchronization/syncmanager.hpp b/src/synchronization/syncmanager.hpp
index ce584c43..04b9c70b 100644
--- a/src/synchronization/syncmanager.hpp
+++ b/src/synchronization/syncmanager.hpp
@@ -23,9 +23,9 @@
 
 
 #include <map>
+#include <thread>
 
 #include <glibmm/main.h>
-#include <glibmm/thread.h>
 
 #include "isyncmanager.hpp"
 
@@ -85,7 +85,7 @@ namespace sync {
     IGnote & m_gnote;
     NoteManagerBase & m_note_manager;
     SyncState m_state;
-    Glib::Thread *m_sync_thread;
+    std::thread *m_sync_thread;
     SyncTitleConflictResolution m_conflict_resolution;
     utils::InterruptableTimeout m_autosync_timer;
     int m_autosync_timeout_pref_minutes;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]