diff options
author | zaxl <zaxl@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2008-11-07 12:29:44 +0000 |
---|---|---|
committer | zaxl <zaxl@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2008-11-07 12:29:44 +0000 |
commit | 01faa77dc857be70df9da067fa32aa47750f75d8 (patch) | |
tree | ebb741253dbb524f8ca43beada5023b0ab594251 /navit/event_glib.c | |
parent | a638f55d07d81c385c588d10ae7eb93f5e70400f (diff) | |
download | navit-01faa77dc857be70df9da067fa32aa47750f75d8.tar.gz |
Add:core: event_call_callback infrastructure|
To be used from threads that want to call the callback
from the main(gui) thread. Users must provide
synhronization of the callback data.
Difference with using timeouts are:
Threads can have own timers
Timer events are low priority, this must be called ASAP.
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@1674 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/event_glib.c')
-rw-r--r-- | navit/event_glib.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/navit/event_glib.c b/navit/event_glib.c index 730d9082a..7fc0bbbf0 100644 --- a/navit/event_glib.c +++ b/navit/event_glib.c @@ -136,6 +136,18 @@ event_glib_remove_idle(struct event_idle *ev) { } +static void +event_glib_call_callback(struct callback *cb) +{ +/* + Idea for implementation: + Create a pipe then use add_watch + add callback to a queue + from here write to the pipe to wakeup the pool + then from the gui thread process the callback queue +*/ +} + static struct event_methods event_glib_methods = { event_glib_main_loop_run, event_glib_main_loop_quit, @@ -145,6 +157,7 @@ static struct event_methods event_glib_methods = { event_glib_remove_timeout, event_glib_add_idle, event_glib_remove_idle, + event_glib_call_callback, }; static void |