Add missing implementation ofsource->priority, g_source_remove_poll.

Thu Feb 22 10:31:36 2001  Owen Taylor  <otaylor@redhat.com>

	* gmain.c (g_source_remove_poll): Add missing implementation
	ofsource->priority,  g_source_remove_poll. (Pointed out by Stefan Westerfeld)
This commit is contained in:
Owen Taylor 2001-02-22 15:39:57 +00:00 committed by Owen Taylor
parent f3ec41e8d2
commit 53be713583
10 changed files with 108 additions and 4 deletions

View File

@ -1,3 +1,8 @@
Thu Feb 22 10:31:36 2001 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_source_remove_poll): Add missing implementation
of g_source_remove_poll. (Pointed out by Stefan Westerfeld)
2001-02-21 Tor Lillqvist <tml@iki.fi>
* gutils.c (g_path_is_absolute): Match also UNC paths on Win32.

View File

@ -1,3 +1,8 @@
Thu Feb 22 10:31:36 2001 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_source_remove_poll): Add missing implementation
of g_source_remove_poll. (Pointed out by Stefan Westerfeld)
2001-02-21 Tor Lillqvist <tml@iki.fi>
* gutils.c (g_path_is_absolute): Match also UNC paths on Win32.

View File

@ -1,3 +1,8 @@
Thu Feb 22 10:31:36 2001 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_source_remove_poll): Add missing implementation
of g_source_remove_poll. (Pointed out by Stefan Westerfeld)
2001-02-21 Tor Lillqvist <tml@iki.fi>
* gutils.c (g_path_is_absolute): Match also UNC paths on Win32.

View File

@ -1,3 +1,8 @@
Thu Feb 22 10:31:36 2001 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_source_remove_poll): Add missing implementation
of g_source_remove_poll. (Pointed out by Stefan Westerfeld)
2001-02-21 Tor Lillqvist <tml@iki.fi>
* gutils.c (g_path_is_absolute): Match also UNC paths on Win32.

View File

@ -1,3 +1,8 @@
Thu Feb 22 10:31:36 2001 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_source_remove_poll): Add missing implementation
of g_source_remove_poll. (Pointed out by Stefan Westerfeld)
2001-02-21 Tor Lillqvist <tml@iki.fi>
* gutils.c (g_path_is_absolute): Match also UNC paths on Win32.

View File

@ -1,3 +1,8 @@
Thu Feb 22 10:31:36 2001 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_source_remove_poll): Add missing implementation
of g_source_remove_poll. (Pointed out by Stefan Westerfeld)
2001-02-21 Tor Lillqvist <tml@iki.fi>
* gutils.c (g_path_is_absolute): Match also UNC paths on Win32.

View File

@ -1,3 +1,8 @@
Thu Feb 22 10:31:36 2001 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_source_remove_poll): Add missing implementation
of g_source_remove_poll. (Pointed out by Stefan Westerfeld)
2001-02-21 Tor Lillqvist <tml@iki.fi>
* gutils.c (g_path_is_absolute): Match also UNC paths on Win32.

View File

@ -1,3 +1,8 @@
Thu Feb 22 10:31:36 2001 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_source_remove_poll): Add missing implementation
of g_source_remove_poll. (Pointed out by Stefan Westerfeld)
2001-02-21 Tor Lillqvist <tml@iki.fi>
* gutils.c (g_path_is_absolute): Match also UNC paths on Win32.

View File

@ -896,12 +896,12 @@ g_source_get_context (GSource *source)
}
/**
* g_main_source_add_poll:
* g_source_add_poll:
* @source:a #GSource
* @fd: a #GPollFD structure holding information about a file
* descriptor to watch.
*
* Add a file descriptor to the set of file descriptors polled * for
* Add a file descriptor to the set of file descriptors polled for
* this source. This is usually combined with g_source_new() to add an
* event source. The event source's check function will typically test
* the revents field in the #GPollFD struct and return %TRUE if events need
@ -931,6 +931,38 @@ g_source_add_poll (GSource *source,
}
}
/**
* g_source_remove_poll:
* @source:a #GSource
* @fd: a #GPollFD structure previously passed to g_source_poll.
*
* Remove a file descriptor from the set of file descriptors polled for
* this source.
**/
void
g_source_remove_poll (GSource *source,
GPollFD *fd)
{
GMainContext *context;
g_return_if_fail (source != NULL);
g_return_if_fail (fd != NULL);
g_return_if_fail (!SOURCE_DESTROYED (source));
context = source->context;
if (context)
LOCK_CONTEXT (context);
source->poll_fds = g_slist_remove (source->poll_fds, fd);
if (context)
{
g_main_context_remove_poll_unlocked (context, fd);
UNLOCK_CONTEXT (context);
}
}
/**
* g_source_set_callback_indirect:
* @source: the source

36
gmain.c
View File

@ -896,12 +896,12 @@ g_source_get_context (GSource *source)
}
/**
* g_main_source_add_poll:
* g_source_add_poll:
* @source:a #GSource
* @fd: a #GPollFD structure holding information about a file
* descriptor to watch.
*
* Add a file descriptor to the set of file descriptors polled * for
* Add a file descriptor to the set of file descriptors polled for
* this source. This is usually combined with g_source_new() to add an
* event source. The event source's check function will typically test
* the revents field in the #GPollFD struct and return %TRUE if events need
@ -931,6 +931,38 @@ g_source_add_poll (GSource *source,
}
}
/**
* g_source_remove_poll:
* @source:a #GSource
* @fd: a #GPollFD structure previously passed to g_source_poll.
*
* Remove a file descriptor from the set of file descriptors polled for
* this source.
**/
void
g_source_remove_poll (GSource *source,
GPollFD *fd)
{
GMainContext *context;
g_return_if_fail (source != NULL);
g_return_if_fail (fd != NULL);
g_return_if_fail (!SOURCE_DESTROYED (source));
context = source->context;
if (context)
LOCK_CONTEXT (context);
source->poll_fds = g_slist_remove (source->poll_fds, fd);
if (context)
{
g_main_context_remove_poll_unlocked (context, fd);
UNLOCK_CONTEXT (context);
}
}
/**
* g_source_set_callback_indirect:
* @source: the source