aboutsummaryrefslogtreecommitdiff
path: root/src/lib/eventloop.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/eventloop.c')
-rw-r--r--src/lib/eventloop.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/lib/eventloop.c b/src/lib/eventloop.c
index 05ae23ad..331048d1 100644
--- a/src/lib/eventloop.c
+++ b/src/lib/eventloop.c
@@ -95,10 +95,6 @@ struct GNUNET_GTK_MainLoop
95 */ 95 */
96 guint poll_array_active; 96 guint poll_array_active;
97 97
98 /**
99 * Maximum GTK priority.
100 */
101 gint max_priority;
102 98
103#if WINDOWS 99#if WINDOWS
104 /** 100 /**
@@ -268,6 +264,7 @@ gnunet_gtk_select (void *cls,
268 fd_set aexcept; 264 fd_set aexcept;
269 int pre_ret = 0; 265 int pre_ret = 0;
270 int result = 0; 266 int result = 0;
267 gint max_priority;
271 268
272#if WINDOWS 269#if WINDOWS
273 int sock_read = 0; 270 int sock_read = 0;
@@ -340,6 +337,7 @@ gnunet_gtk_select (void *cls,
340 fd_counter++; 337 fd_counter++;
341 } 338 }
342#else 339#else
340 /* FIXME: why while(1) here!? */
343 while (1) 341 while (1)
344 { 342 {
345 struct GNUNET_CONTAINER_SList_Iterator *t; 343 struct GNUNET_CONTAINER_SList_Iterator *t;
@@ -515,11 +513,12 @@ gnunet_gtk_select (void *cls,
515 socks = sock_read + sock_write + sock_err; 513 socks = sock_read + sock_write + sock_err;
516#endif 514#endif
517 515
518 g_main_context_prepare (ml->gmc, &ml->max_priority); 516 /* combine with Gtk events */
517 g_main_context_prepare (ml->gmc, &max_priority);
519 while (1) 518 while (1)
520 { 519 {
521 need_gfds = g_main_context_query (ml->gmc, 520 need_gfds = g_main_context_query (ml->gmc,
522 ml->max_priority, 521 max_priority,
523 &delay, 522 &delay,
524 &ml->cached_poll_array[fd_counter], 523 &ml->cached_poll_array[fd_counter],
525 ml->cached_poll_array_size - fd_counter); 524 ml->cached_poll_array_size - fd_counter);
@@ -569,7 +568,7 @@ gnunet_gtk_select (void *cls,
569 * Startup reason is used to pass the scheduler sanity check. 568 * Startup reason is used to pass the scheduler sanity check.
570 */ 569 */
571 if (TRUE == g_main_context_check (ml->gmc, 570 if (TRUE == g_main_context_check (ml->gmc,
572 ml->max_priority, 571 max_priority,
573 &ml->cached_poll_array[fd_counter], 572 &ml->cached_poll_array[fd_counter],
574 need_gfds)) 573 need_gfds))
575 GNUNET_SCHEDULER_add_continuation (gnunet_gtk_dispatch_task, ml, 574 GNUNET_SCHEDULER_add_continuation (gnunet_gtk_dispatch_task, ml,