Allocate space for pollfd's _after_ adding poll wake-up-pipe record.

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

	* gmain.c (g_main_poll): Allocate space for pollfd's
	_after_ adding poll wake-up-pipe record.

	* gmain.c (g_main_add_poll): Changed name
	of internal function g_main_add_poll_unlocked()
	back from the non-sensical g_main_add_unlocking_poll().
This commit is contained in:
Owen Taylor 1998-12-19 22:11:49 +00:00 committed by Owen Taylor
parent ce257b8137
commit bb19315fbd
10 changed files with 88 additions and 12 deletions

View File

@ -1,3 +1,12 @@
Sat Dec 19 16:56:02 1998 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_main_poll): Allocate space for pollfd's
_after_ adding poll wake-up-pipe record.
* gmain.c (g_main_add_poll): Changed name
of internal function g_main_add_poll_unlocked()
back from the non-sensical g_main_add_unlocking_poll().
Sat Dec 19 06:25:55 1998 Tim Janik <timj@gtk.org>
* glib.m4: fixed a minor bug that would let configures bail out

View File

@ -1,3 +1,12 @@
Sat Dec 19 16:56:02 1998 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_main_poll): Allocate space for pollfd's
_after_ adding poll wake-up-pipe record.
* gmain.c (g_main_add_poll): Changed name
of internal function g_main_add_poll_unlocked()
back from the non-sensical g_main_add_unlocking_poll().
Sat Dec 19 06:25:55 1998 Tim Janik <timj@gtk.org>
* glib.m4: fixed a minor bug that would let configures bail out

View File

@ -1,3 +1,12 @@
Sat Dec 19 16:56:02 1998 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_main_poll): Allocate space for pollfd's
_after_ adding poll wake-up-pipe record.
* gmain.c (g_main_add_poll): Changed name
of internal function g_main_add_poll_unlocked()
back from the non-sensical g_main_add_unlocking_poll().
Sat Dec 19 06:25:55 1998 Tim Janik <timj@gtk.org>
* glib.m4: fixed a minor bug that would let configures bail out

View File

@ -1,3 +1,12 @@
Sat Dec 19 16:56:02 1998 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_main_poll): Allocate space for pollfd's
_after_ adding poll wake-up-pipe record.
* gmain.c (g_main_add_poll): Changed name
of internal function g_main_add_poll_unlocked()
back from the non-sensical g_main_add_unlocking_poll().
Sat Dec 19 06:25:55 1998 Tim Janik <timj@gtk.org>
* glib.m4: fixed a minor bug that would let configures bail out

View File

@ -1,3 +1,12 @@
Sat Dec 19 16:56:02 1998 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_main_poll): Allocate space for pollfd's
_after_ adding poll wake-up-pipe record.
* gmain.c (g_main_add_poll): Changed name
of internal function g_main_add_poll_unlocked()
back from the non-sensical g_main_add_unlocking_poll().
Sat Dec 19 06:25:55 1998 Tim Janik <timj@gtk.org>
* glib.m4: fixed a minor bug that would let configures bail out

View File

@ -1,3 +1,12 @@
Sat Dec 19 16:56:02 1998 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_main_poll): Allocate space for pollfd's
_after_ adding poll wake-up-pipe record.
* gmain.c (g_main_add_poll): Changed name
of internal function g_main_add_poll_unlocked()
back from the non-sensical g_main_add_unlocking_poll().
Sat Dec 19 06:25:55 1998 Tim Janik <timj@gtk.org>
* glib.m4: fixed a minor bug that would let configures bail out

View File

@ -1,3 +1,12 @@
Sat Dec 19 16:56:02 1998 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_main_poll): Allocate space for pollfd's
_after_ adding poll wake-up-pipe record.
* gmain.c (g_main_add_poll): Changed name
of internal function g_main_add_poll_unlocked()
back from the non-sensical g_main_add_unlocking_poll().
Sat Dec 19 06:25:55 1998 Tim Janik <timj@gtk.org>
* glib.m4: fixed a minor bug that would let configures bail out

View File

@ -1,3 +1,12 @@
Sat Dec 19 16:56:02 1998 Owen Taylor <otaylor@redhat.com>
* gmain.c (g_main_poll): Allocate space for pollfd's
_after_ adding poll wake-up-pipe record.
* gmain.c (g_main_add_poll): Changed name
of internal function g_main_add_poll_unlocked()
back from the non-sensical g_main_add_unlocking_poll().
Sat Dec 19 06:25:55 1998 Tim Janik <timj@gtk.org>
* glib.m4: fixed a minor bug that would let configures bail out

View File

@ -83,7 +83,7 @@ struct _GPollRec
static void g_main_poll (gint timeout,
gboolean use_priority,
gint priority);
static void g_main_add_unlocking_poll (gint priority,
static void g_main_add_poll_unlocked (gint priority,
GPollFD *fd);
static gboolean g_timeout_prepare (gpointer source_data,
@ -649,7 +649,7 @@ g_main_poll (gint timeout,
gboolean use_priority,
gint priority)
{
GPollFD *fd_array = g_new (GPollFD, n_poll_records);
GPollFD *fd_array;
GPollRec *pollrec;
gint i;
@ -663,9 +663,11 @@ g_main_poll (gint timeout,
wake_up_rec.fd = wake_up_pipe[0];
wake_up_rec.events = G_IO_IN;
g_main_add_unlocking_poll (0, &wake_up_rec);
g_main_add_poll_unlocked (0, &wake_up_rec);
}
fd_array = g_new (GPollFD, n_poll_records);
pollrec = poll_records;
i = 0;
while (pollrec && (!use_priority || priority >= pollrec->priority))
@ -710,14 +712,14 @@ g_main_add_poll (GPollFD *fd,
gint priority)
{
G_LOCK (main_loop);
g_main_add_unlocking_poll (priority, fd);
g_main_add_poll_unlocked (priority, fd);
G_UNLOCK (main_loop);
}
/* HOLDS: main_loop_lock */
static void
g_main_add_unlocking_poll (gint priority,
GPollFD *fd)
g_main_add_poll_unlocked (gint priority,
GPollFD *fd)
{
GPollRec *lastrec, *pollrec, *newrec;

14
gmain.c
View File

@ -83,7 +83,7 @@ struct _GPollRec
static void g_main_poll (gint timeout,
gboolean use_priority,
gint priority);
static void g_main_add_unlocking_poll (gint priority,
static void g_main_add_poll_unlocked (gint priority,
GPollFD *fd);
static gboolean g_timeout_prepare (gpointer source_data,
@ -649,7 +649,7 @@ g_main_poll (gint timeout,
gboolean use_priority,
gint priority)
{
GPollFD *fd_array = g_new (GPollFD, n_poll_records);
GPollFD *fd_array;
GPollRec *pollrec;
gint i;
@ -663,9 +663,11 @@ g_main_poll (gint timeout,
wake_up_rec.fd = wake_up_pipe[0];
wake_up_rec.events = G_IO_IN;
g_main_add_unlocking_poll (0, &wake_up_rec);
g_main_add_poll_unlocked (0, &wake_up_rec);
}
fd_array = g_new (GPollFD, n_poll_records);
pollrec = poll_records;
i = 0;
while (pollrec && (!use_priority || priority >= pollrec->priority))
@ -710,14 +712,14 @@ g_main_add_poll (GPollFD *fd,
gint priority)
{
G_LOCK (main_loop);
g_main_add_unlocking_poll (priority, fd);
g_main_add_poll_unlocked (priority, fd);
G_UNLOCK (main_loop);
}
/* HOLDS: main_loop_lock */
static void
g_main_add_unlocking_poll (gint priority,
GPollFD *fd)
g_main_add_poll_unlocked (gint priority,
GPollFD *fd)
{
GPollRec *lastrec, *pollrec, *newrec;