15 #include "atomic_queue.h"
16 #include "xscheduler.h"
18 threadid_t g_main_thread_id = threadID();
21 return is_thread_equal(threadID(), g_main_thread_id);
24 XListener::XListener(FLAGS flags) :
26 if(flags & FLAG_AVOID_DUP) {
27 assert(flags & FLAG_MAIN_THREAD_CALL);
29 if((flags & FLAG_DELAY_SHORT) || (flags & FLAG_DELAY_ADAPTIVE)) {
30 assert(flags & FLAG_AVOID_DUP);
33 XListener::~XListener() {}
37 unsigned int delay = std::min(20u, (
unsigned int)g_adaptiveDelay);
38 if(m_flags & FLAG_DELAY_ADAPTIVE)
39 delay = g_adaptiveDelay;
40 if(m_flags & FLAG_DELAY_SHORT)