feat add event_bus #1

Merged
tqcq merged 19 commits from feat/support_event_bus into master 2024-04-02 12:41:20 +08:00
2 changed files with 13 additions and 4 deletions
Showing only changes of commit b8ceaa7fcd - Show all commits

View File

@ -4,13 +4,20 @@ namespace sigslot {
#ifdef _SIGSLOT_HAS_POSIX_THREADS #ifdef _SIGSLOT_HAS_POSIX_THREADS
sled::Mutex * sled::RecursiveMutex *
multi_threaded_global::get_mutex() multi_threaded_global::get_mutex()
{ {
static sled::Mutex g_mutex; static sled::RecursiveMutex g_mutex;
return &g_mutex; return &g_mutex;
} }
// sled::Mutex *
// multi_threaded_global::get_mutex()
// {
// static sled::Mutex g_mutex;
// return &g_mutex;
// }
// pthread_mutex_t * // pthread_mutex_t *
// multi_threaded_global::get_mutex() // multi_threaded_global::get_mutex()
// { // {

View File

@ -196,7 +196,8 @@ public:
} }
private: private:
static sled::Mutex *get_mutex(); static sled::RecursiveMutex *get_mutex();
// static sled::Mutex *get_mutex();
// static pthread_mutex_t *get_mutex(); // static pthread_mutex_t *get_mutex();
}; };
@ -224,7 +225,8 @@ public:
} }
private: private:
sled::Mutex mutex_; sled::RecursiveMutex mutex_;
// sled::Mutex mutex_;
// pthread_mutex_t m_mutex; // pthread_mutex_t m_mutex;
}; };
#endif// _SIGSLOT_HAS_POSIX_THREADS #endif// _SIGSLOT_HAS_POSIX_THREADS