/* * ThreadGuard.hpp * * Created on: Jun 17, 2015 * Author: heber */ #ifndef THREADGUARD_HPP_ #define THREADGUARD_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include "CodePatterns/Assert.hpp" #ifdef HAVE_PTHREAD #include extern pthread_t actionqueue_global_threadid; #endif #define THREAD_BOUNCER \ ASSERT (actionqueue_global_threadid != pthread_self(), \ "ThreadBouncer - actionqueue thread "+toString(pthread_self()) \ +" entered function realm of Qt thread." ); #define THREAD_VIP \ ASSERT (actionqueue_global_threadid == pthread_self(), \ "ThreadVIP - thread "+toString(pthread_self()) \ +" entered function realm of actionqueue thread " \ +toString(actionqueue_global_threadid) ); #endif /* THREADGUARD_HPP_ */