[beast: 14/20] BSE: use this_thread_self/set_name instead of Rapicorn::ThreadInfo



commit 5daa0c94160c00211a80e1075d9b564a219ce381
Author: Tim Janik <timj gnu org>
Date:   Sun Sep 17 12:39:51 2017 +0200

    BSE: use this_thread_self/set_name instead of Rapicorn::ThreadInfo
    
    Signed-off-by: Tim Janik <timj gnu org>

 beast-gtk/bstmain.cc |    4 ++--
 bse/bsesequencer.cc  |    6 +++---
 sfi/bcore.hh         |    1 -
 3 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/beast-gtk/bstmain.cc b/beast-gtk/bstmain.cc
index 8be28a8..41c0516 100644
--- a/beast-gtk/bstmain.cc
+++ b/beast-gtk/bstmain.cc
@@ -103,8 +103,8 @@ main (int argc, char *argv[])
   Py_Initialize();
 
   // initialize threading and GLib types
-  Bse::ThreadInfo::self().name ("Beast GUI");
-  Bse::TaskRegistry::add (Bse::ThreadInfo::self().name(), Bse::this_thread_getpid(), 
Bse::this_thread_gettid());
+  Bse::this_thread_set_name ("Beast GUI");
+  Bse::TaskRegistry::add (Bse::this_thread_get_name(), Bse::this_thread_getpid(), Bse::this_thread_gettid());
 
   /* initialize Birnet/Sfi */
   sfi_init (&argc, argv);
diff --git a/bse/bsesequencer.cc b/bse/bsesequencer.cc
index 6891434..3f928de 100644
--- a/bse/bsesequencer.cc
+++ b/bse/bsesequencer.cc
@@ -25,7 +25,7 @@ namespace Bse {
 
 Sequencer              *Sequencer::singleton_ = NULL;
 std::mutex              Sequencer::sequencer_mutex_;
-static ThreadInfo      *sequencer_thread_self = NULL;
+static Bse::ThreadId    sequencer_thread_self;
 
 class Sequencer::PollPool {
 public:
@@ -162,7 +162,7 @@ Sequencer::remove_io_watch (BseIOWatch watch_func, void *watch_data)
   std::unique_lock<std::mutex> sequencer_guard (sequencer_mutex_);
   if (current_watch_func == watch_func && current_watch_data == watch_data)
     {  /* watch_func() to be removed is currently in call */
-      if (&ThreadInfo::self() == sequencer_thread_self)
+      if (Bse::this_thread_self() == sequencer_thread_self)
         {
           /* allow removal calls from within a watch_func() */
           removal_success = !current_watch_needs_remove1;       /* catch multiple calls */
@@ -332,7 +332,7 @@ void
 Sequencer::sequencer_thread ()
 {
   Bse::TaskRegistry::add ("Sequencer", Bse::this_thread_getpid(), Bse::this_thread_gettid());
-  sequencer_thread_self = &ThreadInfo::self();
+  sequencer_thread_self = Bse::this_thread_self();
   SDEBUG ("thrdstrt: now=%llu", Bse::TickStamp::current());
   Bse::TickStampWakeupP wakeup = Bse::TickStamp::create_wakeup ([&]() { this->wakeup(); });
   BSE_SEQUENCER_LOCK();
diff --git a/sfi/bcore.hh b/sfi/bcore.hh
index 157d693..f15c5ed 100644
--- a/sfi/bcore.hh
+++ b/sfi/bcore.hh
@@ -33,7 +33,6 @@ using   Rapicorn::DataListContainer;
 using   Rapicorn::void_t;
 using   Rapicorn::Blob;
 using   Rapicorn::Res;
-using   Rapicorn::ThreadInfo;
 using   Rapicorn::cpu_info;
 using   Rapicorn::AsyncBlockingQueue;
 


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