summaryrefslogtreecommitdiffstats
path: root/server/main_dispatcher.h
diff options
context:
space:
mode:
authorAlon Levy <alevy@redhat.com>2011-09-08 02:16:24 +0300
committerAlon Levy <alevy@redhat.com>2011-10-31 17:35:54 +0200
commitbd8771adbcf3ff34d14333cf874191e8d105f612 (patch)
tree5c867e871cd4aea5acb4a92aba9883372aa8e7b1 /server/main_dispatcher.h
parentedb91ccc09e4fd4cad0940d88f3455651eb7c367 (diff)
downloadspice-bd8771adbcf3ff34d14333cf874191e8d105f612.tar.gz
spice-bd8771adbcf3ff34d14333cf874191e8d105f612.tar.xz
spice-bd8771adbcf3ff34d14333cf874191e8d105f612.zip
[0.8 branch] server: add main_dispatcher
add main_dispatcher, a message passing mechanism for sending messages to the main thread. The main thread is the thread that implements SpiceCoreInterface, which is assumed to be a single thread. Similar to the async operation of red_worker, a socket pair is created and used to pass messages. The messages are a fixed size to ease parsing. A single message is defined to pass a channel_event. RHBZ: 746950 FDBZ: 41858 This patch is 0.8 branch only, for the master branch there should be a better approach to share code with red_dispatcher and ready the way for later adding more threads. cherry-pick from 0.8 80caf07e09efe14c67f89a3c01501a6a39681167 Conflicts: server/reds.c
Diffstat (limited to 'server/main_dispatcher.h')
-rw-r--r--server/main_dispatcher.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/server/main_dispatcher.h b/server/main_dispatcher.h
new file mode 100644
index 00000000..2c201c75
--- /dev/null
+++ b/server/main_dispatcher.h
@@ -0,0 +1,9 @@
+#ifndef MAIN_DISPATCHER_H
+#define MAIN_DISPATCHER_H
+
+#include <spice.h>
+
+void main_dispatcher_channel_event(int event, SpiceChannelEventInfo *info);
+void main_dispatcher_init(SpiceCoreInterface *core);
+
+#endif //MAIN_DISPATCHER_H