Develop: 新增IS_AUDIO_THREAD宏
This commit is contained in:
parent
d09302dab2
commit
400861ba0f
@ -5,3 +5,6 @@
|
||||
|
||||
thread_message_hub g_main_thread_hub;
|
||||
thread_message_hub g_audio_thread_hub;
|
||||
|
||||
std::thread::id g_main_thread_id = std::this_thread::get_id();
|
||||
std::thread::id g_audio_thread_id;
|
||||
|
@ -1,7 +1,15 @@
|
||||
#pragma once
|
||||
#include <thread>
|
||||
|
||||
#include "thread_message_hub.h"
|
||||
|
||||
CORE_API extern thread_message_hub g_main_thread_hub;
|
||||
CORE_API extern thread_message_hub g_audio_thread_hub;
|
||||
|
||||
CORE_API extern std::thread::id g_main_thread_id;
|
||||
CORE_API extern std::thread::id g_audio_thread_id;
|
||||
|
||||
#define PUSH_MAIN_THREAD(code) g_main_thread_hub.push_message(code);
|
||||
|
||||
#define IS_MAIN_THREAD() (std::this_thread::get_id() == g_main_thread_id)
|
||||
#define IS_AUDIO_THREAD() (std::this_thread::get_id() == g_audio_thread_id)
|
||||
|
Loading…
x
Reference in New Issue
Block a user