Add #defines defining scale of priorities.

Sat Dec 19 16:56:02 1998  Owen Taylor  <otaylor@redhat.com>

	* glib.h gmain.c (G_PRIORITY_LOW): Add #defines defining
	scale of priorities.
This commit is contained in:
Owen Taylor 1998-12-19 22:21:39 +00:00 committed by Owen Taylor
parent bb19315fbd
commit 7f237f6fcd
12 changed files with 64 additions and 6 deletions

View File

@ -1,3 +1,8 @@
Sat Dec 19 16:56:02 1998 Owen Taylor <otaylor@redhat.com>
* glib.h gmain.c (G_PRIORITY_LOW): Add #defines defining
scale of priorities.
Sat Dec 19 16:56:02 1998 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_main_poll): Allocate space for pollfd's

View File

@ -1,3 +1,8 @@
Sat Dec 19 16:56:02 1998 Owen Taylor <otaylor@redhat.com>
* glib.h gmain.c (G_PRIORITY_LOW): Add #defines defining
scale of priorities.
Sat Dec 19 16:56:02 1998 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_main_poll): Allocate space for pollfd's

View File

@ -1,3 +1,8 @@
Sat Dec 19 16:56:02 1998 Owen Taylor <otaylor@redhat.com>
* glib.h gmain.c (G_PRIORITY_LOW): Add #defines defining
scale of priorities.
Sat Dec 19 16:56:02 1998 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_main_poll): Allocate space for pollfd's

View File

@ -1,3 +1,8 @@
Sat Dec 19 16:56:02 1998 Owen Taylor <otaylor@redhat.com>
* glib.h gmain.c (G_PRIORITY_LOW): Add #defines defining
scale of priorities.
Sat Dec 19 16:56:02 1998 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_main_poll): Allocate space for pollfd's

View File

@ -1,3 +1,8 @@
Sat Dec 19 16:56:02 1998 Owen Taylor <otaylor@redhat.com>
* glib.h gmain.c (G_PRIORITY_LOW): Add #defines defining
scale of priorities.
Sat Dec 19 16:56:02 1998 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_main_poll): Allocate space for pollfd's

View File

@ -1,3 +1,8 @@
Sat Dec 19 16:56:02 1998 Owen Taylor <otaylor@redhat.com>
* glib.h gmain.c (G_PRIORITY_LOW): Add #defines defining
scale of priorities.
Sat Dec 19 16:56:02 1998 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_main_poll): Allocate space for pollfd's

View File

@ -1,3 +1,8 @@
Sat Dec 19 16:56:02 1998 Owen Taylor <otaylor@redhat.com>
* glib.h gmain.c (G_PRIORITY_LOW): Add #defines defining
scale of priorities.
Sat Dec 19 16:56:02 1998 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_main_poll): Allocate space for pollfd's

View File

@ -1,3 +1,8 @@
Sat Dec 19 16:56:02 1998 Owen Taylor <otaylor@redhat.com>
* glib.h gmain.c (G_PRIORITY_LOW): Add #defines defining
scale of priorities.
Sat Dec 19 16:56:02 1998 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_main_poll): Allocate space for pollfd's

8
glib.h
View File

@ -2386,6 +2386,14 @@ struct _GSourceFuncs
GDestroyNotify destroy;
};
/* Standard priorities */
#define G_PRIORITY_HIGH -100
#define G_PRIORITY_DEFAULT 0
#define G_PRIORITY_HIGH_IDLE 100
#define G_PRIORITY_DEFAULT_IDLE 200
#define G_PRIORITY_LOW 300
typedef gboolean (*GSourceFunc) (gpointer data);
/* Hooks for adding to the main loop */

View File

@ -2386,6 +2386,14 @@ struct _GSourceFuncs
GDestroyNotify destroy;
};
/* Standard priorities */
#define G_PRIORITY_HIGH -100
#define G_PRIORITY_DEFAULT 0
#define G_PRIORITY_HIGH_IDLE 100
#define G_PRIORITY_DEFAULT_IDLE 200
#define G_PRIORITY_LOW 300
typedef gboolean (*GSourceFunc) (gpointer data);
/* Hooks for adding to the main loop */

View File

@ -287,7 +287,7 @@ g_source_remove (guint tag)
if (hook)
{
GSource *source = (GSource *)hook;
((GSourceFuncs *) source->hook.func)->destroy (source->source_data);
g_hook_destroy_link (&source_list, hook);
}
@ -888,7 +888,8 @@ g_timeout_add (guint32 interval,
GSourceFunc function,
gpointer data)
{
return g_timeout_add_full (0, interval, function, data, NULL);
return g_timeout_add_full (G_PRIORITY_DEFAULT,
interval, function, data, NULL);
}
/* Idle functions */
@ -936,5 +937,5 @@ guint
g_idle_add (GSourceFunc function,
gpointer data)
{
return g_idle_add_full (0, function, data, NULL);
return g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, function, data, NULL);
}

View File

@ -287,7 +287,7 @@ g_source_remove (guint tag)
if (hook)
{
GSource *source = (GSource *)hook;
((GSourceFuncs *) source->hook.func)->destroy (source->source_data);
g_hook_destroy_link (&source_list, hook);
}
@ -888,7 +888,8 @@ g_timeout_add (guint32 interval,
GSourceFunc function,
gpointer data)
{
return g_timeout_add_full (0, interval, function, data, NULL);
return g_timeout_add_full (G_PRIORITY_DEFAULT,
interval, function, data, NULL);
}
/* Idle functions */
@ -936,5 +937,5 @@ guint
g_idle_add (GSourceFunc function,
gpointer data)
{
return g_idle_add_full (0, function, data, NULL);
return g_idle_add_full (G_PRIORITY_DEFAULT_IDLE, function, data, NULL);
}