mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-08 11:55:47 +01:00
Recurse with may_block = FALSE, so we don't get into the pathology where
Thu Nov 1 21:48:43 2001 Owen Taylor <otaylor@redhat.com> * tests/mainloop-test.c (recurser_idle): Recurse with may_block = FALSE, so we don't get into the pathology where the recurser_idle recurses for 10 iterations, and the only thing that is running is the recurser idle, which adds another recursion for each of those 10 iterations and.... * tests/mainloop-test.c (create_crawler): Fix race condition where a crawler source could be destroyed before it was added to the crawler array. * test/Makefile.am: Add mainloop-test back.
This commit is contained in:
parent
018c5f7d6b
commit
3481763c97
16
ChangeLog
16
ChangeLog
@ -1,3 +1,19 @@
|
||||
Thu Nov 1 21:48:43 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* tests/mainloop-test.c (recurser_idle): Recurse
|
||||
with may_block = FALSE, so we don't get into
|
||||
the pathology where the recurser_idle recurses
|
||||
for 10 iterations, and the only thing that is
|
||||
running is the recurser idle, which adds
|
||||
another recursion for each of those 10 iterations
|
||||
and....
|
||||
|
||||
* tests/mainloop-test.c (create_crawler): Fix race
|
||||
condition where a crawler source could be destroyed
|
||||
before it was added to the crawler array.
|
||||
|
||||
* test/Makefile.am: Add mainloop-test back.
|
||||
|
||||
2001-11-01 Marius Andreiana <mandreiana@yahoo.com>
|
||||
|
||||
* configure.in: Added ro (Romanian) to ALL_LINGUAS
|
||||
|
@ -1,3 +1,19 @@
|
||||
Thu Nov 1 21:48:43 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* tests/mainloop-test.c (recurser_idle): Recurse
|
||||
with may_block = FALSE, so we don't get into
|
||||
the pathology where the recurser_idle recurses
|
||||
for 10 iterations, and the only thing that is
|
||||
running is the recurser idle, which adds
|
||||
another recursion for each of those 10 iterations
|
||||
and....
|
||||
|
||||
* tests/mainloop-test.c (create_crawler): Fix race
|
||||
condition where a crawler source could be destroyed
|
||||
before it was added to the crawler array.
|
||||
|
||||
* test/Makefile.am: Add mainloop-test back.
|
||||
|
||||
2001-11-01 Marius Andreiana <mandreiana@yahoo.com>
|
||||
|
||||
* configure.in: Added ro (Romanian) to ALL_LINGUAS
|
||||
|
@ -1,3 +1,19 @@
|
||||
Thu Nov 1 21:48:43 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* tests/mainloop-test.c (recurser_idle): Recurse
|
||||
with may_block = FALSE, so we don't get into
|
||||
the pathology where the recurser_idle recurses
|
||||
for 10 iterations, and the only thing that is
|
||||
running is the recurser idle, which adds
|
||||
another recursion for each of those 10 iterations
|
||||
and....
|
||||
|
||||
* tests/mainloop-test.c (create_crawler): Fix race
|
||||
condition where a crawler source could be destroyed
|
||||
before it was added to the crawler array.
|
||||
|
||||
* test/Makefile.am: Add mainloop-test back.
|
||||
|
||||
2001-11-01 Marius Andreiana <mandreiana@yahoo.com>
|
||||
|
||||
* configure.in: Added ro (Romanian) to ALL_LINGUAS
|
||||
|
@ -1,3 +1,19 @@
|
||||
Thu Nov 1 21:48:43 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* tests/mainloop-test.c (recurser_idle): Recurse
|
||||
with may_block = FALSE, so we don't get into
|
||||
the pathology where the recurser_idle recurses
|
||||
for 10 iterations, and the only thing that is
|
||||
running is the recurser idle, which adds
|
||||
another recursion for each of those 10 iterations
|
||||
and....
|
||||
|
||||
* tests/mainloop-test.c (create_crawler): Fix race
|
||||
condition where a crawler source could be destroyed
|
||||
before it was added to the crawler array.
|
||||
|
||||
* test/Makefile.am: Add mainloop-test back.
|
||||
|
||||
2001-11-01 Marius Andreiana <mandreiana@yahoo.com>
|
||||
|
||||
* configure.in: Added ro (Romanian) to ALL_LINGUAS
|
||||
|
@ -1,3 +1,19 @@
|
||||
Thu Nov 1 21:48:43 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* tests/mainloop-test.c (recurser_idle): Recurse
|
||||
with may_block = FALSE, so we don't get into
|
||||
the pathology where the recurser_idle recurses
|
||||
for 10 iterations, and the only thing that is
|
||||
running is the recurser idle, which adds
|
||||
another recursion for each of those 10 iterations
|
||||
and....
|
||||
|
||||
* tests/mainloop-test.c (create_crawler): Fix race
|
||||
condition where a crawler source could be destroyed
|
||||
before it was added to the crawler array.
|
||||
|
||||
* test/Makefile.am: Add mainloop-test back.
|
||||
|
||||
2001-11-01 Marius Andreiana <mandreiana@yahoo.com>
|
||||
|
||||
* configure.in: Added ro (Romanian) to ALL_LINGUAS
|
||||
|
@ -1,3 +1,19 @@
|
||||
Thu Nov 1 21:48:43 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* tests/mainloop-test.c (recurser_idle): Recurse
|
||||
with may_block = FALSE, so we don't get into
|
||||
the pathology where the recurser_idle recurses
|
||||
for 10 iterations, and the only thing that is
|
||||
running is the recurser idle, which adds
|
||||
another recursion for each of those 10 iterations
|
||||
and....
|
||||
|
||||
* tests/mainloop-test.c (create_crawler): Fix race
|
||||
condition where a crawler source could be destroyed
|
||||
before it was added to the crawler array.
|
||||
|
||||
* test/Makefile.am: Add mainloop-test back.
|
||||
|
||||
2001-11-01 Marius Andreiana <mandreiana@yahoo.com>
|
||||
|
||||
* configure.in: Added ro (Romanian) to ALL_LINGUAS
|
||||
|
@ -1,3 +1,19 @@
|
||||
Thu Nov 1 21:48:43 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* tests/mainloop-test.c (recurser_idle): Recurse
|
||||
with may_block = FALSE, so we don't get into
|
||||
the pathology where the recurser_idle recurses
|
||||
for 10 iterations, and the only thing that is
|
||||
running is the recurser idle, which adds
|
||||
another recursion for each of those 10 iterations
|
||||
and....
|
||||
|
||||
* tests/mainloop-test.c (create_crawler): Fix race
|
||||
condition where a crawler source could be destroyed
|
||||
before it was added to the crawler array.
|
||||
|
||||
* test/Makefile.am: Add mainloop-test back.
|
||||
|
||||
2001-11-01 Marius Andreiana <mandreiana@yahoo.com>
|
||||
|
||||
* configure.in: Added ro (Romanian) to ALL_LINGUAS
|
||||
|
@ -1,3 +1,19 @@
|
||||
Thu Nov 1 21:48:43 2001 Owen Taylor <otaylor@redhat.com>
|
||||
|
||||
* tests/mainloop-test.c (recurser_idle): Recurse
|
||||
with may_block = FALSE, so we don't get into
|
||||
the pathology where the recurser_idle recurses
|
||||
for 10 iterations, and the only thing that is
|
||||
running is the recurser idle, which adds
|
||||
another recursion for each of those 10 iterations
|
||||
and....
|
||||
|
||||
* tests/mainloop-test.c (create_crawler): Fix race
|
||||
condition where a crawler source could be destroyed
|
||||
before it was added to the crawler array.
|
||||
|
||||
* test/Makefile.am: Add mainloop-test back.
|
||||
|
||||
2001-11-01 Marius Andreiana <mandreiana@yahoo.com>
|
||||
|
||||
* configure.in: Added ro (Romanian) to ALL_LINGUAS
|
||||
|
@ -62,6 +62,7 @@ test_programs = \
|
||||
hash-test \
|
||||
iochannel-test \
|
||||
list-test \
|
||||
mainloop-test \
|
||||
module-test \
|
||||
node-test \
|
||||
queue-test \
|
||||
@ -102,7 +103,7 @@ gio_test_LDADD = $(progs_LDADD)
|
||||
hash_test_LDADD = $(progs_LDADD)
|
||||
iochannel_test_LDADD = $(progs_LDADD)
|
||||
list_test_LDADD = $(progs_LDADD)
|
||||
#mainloop_test_LDADD = $(thread_LDADD)
|
||||
mainloop_test_LDADD = $(thread_LDADD)
|
||||
markup_test_LDADD = $(progs_LDADD)
|
||||
module_test_LDADD = $(module_LDADD)
|
||||
module_test_LDFLAGS = @G_MODULE_LDFLAGS@
|
||||
|
@ -18,6 +18,10 @@
|
||||
#define CRAWLER_TIMEOUT_RANGE 40
|
||||
#define RECURSER_TIMEOUT 50
|
||||
|
||||
/* The partial ordering between the context array mutex and
|
||||
* crawler array mutex is that the crawler array mutex cannot
|
||||
* be locked while the context array mutex is locked
|
||||
*/
|
||||
GPtrArray *context_array;
|
||||
GMutex *context_array_mutex;
|
||||
GCond *context_array_cond;
|
||||
@ -327,13 +331,14 @@ create_crawler (void)
|
||||
GSource *source = g_timeout_source_new (g_random_int_range (0, CRAWLER_TIMEOUT_RANGE));
|
||||
g_source_set_callback (source, (GSourceFunc)crawler_callback, source, NULL);
|
||||
|
||||
G_LOCK (crawler_array_lock);
|
||||
g_ptr_array_add (crawler_array, source);
|
||||
|
||||
g_mutex_lock (context_array_mutex);
|
||||
g_source_attach (source, context_array->pdata[g_random_int_range (0, context_array->len)]);
|
||||
g_source_unref (source);
|
||||
g_mutex_unlock (context_array_mutex);
|
||||
|
||||
G_LOCK (crawler_array_lock);
|
||||
g_ptr_array_add (crawler_array, source);
|
||||
G_UNLOCK (crawler_array_lock);
|
||||
}
|
||||
|
||||
@ -361,7 +366,7 @@ recurser_idle (gpointer data)
|
||||
gint i;
|
||||
|
||||
for (i = 0; i < 10; i++)
|
||||
g_main_context_iteration (context, TRUE);
|
||||
g_main_context_iteration (context, FALSE);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user