1 #ifndef _SIGX_DISPATCHER_HPP
2 #define _SIGX_DISPATCHER_HPP
30 #include <sigxconfig.h>
50 typedef std::pair<
const threadhandle_type ,
const threadhandle_type >
thread_pair_type;
56 thread_pair_type
make_thread_pair(threadhandle_type threadA, threadhandle_type threadB);
86 operator bool()
const;
90 const threadhandle_type m_threadA;
95 struct thread_compare:
public std::binary_function<thread_pair_type, thread_pair_type, bool>
97 bool operator ()(
const thread_pair_type& threadpair1,
const thread_pair_type& threadpair2)
const
99 if (threadpair1.first < threadpair2.first)
101 if (threadpair1.first > threadpair2.first)
103 if (threadpair1.second < threadpair2.second)
174 gint queued_contexts()
const;
187 void test_calling_thread();
191 typedef std::queue<tunnel_context_base*> context_container_type;
193 lockable_tunnel_contexts m_tunnel_contexts;
201 volatile gint m_contexts_count;
202 const threadhandle_type m_creator_thread;
233 #endif // end file guard
the base class for all tunnel_context classes.
Definition: tunnel_context_base.h:42
std::pair< const threadhandle_type, const threadhandle_type > thread_pair_type
A pair of threads where pair::first is the smaller one and pair::second the greater one...
Definition: dispatcher.h:50
Ensures allocation of derived objects in the sigx module.
Definition: operator_new.h:33
syncmessages_counter(const threadhandle_type &threadA)
Construct a syncmessages_counter object.
Definition: dispatcher.cpp:181
Definition: dispatcher.h:95
thread_pair_type make_thread_pair(threadhandle_type threadA, threadhandle_type threadB)
Creates a pair of thread handles where the first pair::first is the smaller one of both and pair::sec...
Definition: dispatcher.cpp:172
syncmessages_counter & operator++()
Increase the count of synchronous messages to the server thread.
Definition: dispatcher.cpp:185
Definition: auto_dispatchable.h:27
static_mutex_lockable< sync_messages_type > lockable_sync_messages_type
Definition: dispatcher.h:113
std::map< thread_pair_type, syncmessages_counter, thread_compare > sync_messages_type
Definition: dispatcher.h:112
Makes T_type lockable with a Glib::StaticMutex.
Definition: glib_lockables.h:76
threadhandle_type creator_thread() const
Definition: dispatcher.h:176
static bool deadlock_detection
Whether deadlock detection is turned on.
Definition: dispatcher.h:156
syncmessages_counter & operator--()
Decrease the count of synchronous messages to the server thread.
Definition: dispatcher.cpp:194
Holds a counter of synchronous messages between two threads.
Definition: dispatcher.h:61
bool operator()(const thread_pair_type &threadpair1, const thread_pair_type &threadpair2) const
Definition: dispatcher.h:97
base class denoting the ability to dispatch messages between threads.
Definition: dispatcher.h:140
const void * threadhandle_type
Definition: dispatcher.h:41