GThreadPool defaulted to 0 for max_unused_threads (meaning thread-pool
threads would exit immediately if there was not already another task
waiting for them), and 0 for max_idle_time (meaning unused threads
would linger forever, though this is only relevant if you changed
max_unused_threads).
However, GIOScheduler changed the global defaults to 2 and 15*1000,
respectively, arguing that these were more useful defaults. And they
are, so let's use them.
https://bugzilla.gnome.org/show_bug.cgi?id=661767
g_source_get_context() was checking that the source wasn't destroyed
(since a source doesn't hold a ref on its context, and so
source->context might point to garbage in that case). However, it's
useful to be allowed to call g_source_get_context() on a source that
is destroyed-but-currently-running.
So instead, let g_source_get_context() return the context whenever
it's non-NULL, and clear the source->context of any sources that are
still in a context's sources list when the context is freed. Since
sources are only removed from the list when the source is freed (not
when it is destroyed), this means that now whenever a source has a
non-NULL context pointer, then that pointer is valid.
This also means that g_source_get_time() will now return-if-fail
rather than crashing if it is called on a source whose context has
been destroyed.
Add tests to glib/tests/mainloop to verify that g_source_get_context()
and g_source_get_time() work on destroyed sources.
https://bugzilla.gnome.org/show_bug.cgi?id=661767
Verify that
- g_source_get_time() does not change within a single callback
(even if the real time does)
- g_source_get_time() does not change between different callbacks in
the same mainloop iteration
- g_source_get_time() does change between iterations if the real
time did.
https://bugzilla.gnome.org/show_bug.cgi?id=661767
When creating a directory fails for some reason other than
the parent not existing, don't clear the error before we try
to propagate it.
To reproduce, run 'ostadmin init' on /ostree or otherwise try to
run the function on a directory with a parent directory where the
current user is not allowed to write.
https://bugzilla.gnome.org/show_bug.cgi?id=680823
This looks like it was stubbed out but not implemented; the vtable
entry dates to commit 3781343738 which
is just alex's initial merge of gio into glib.
I was working on some code that wants an asynchronous rm -rf
equivalent, and so yeah, this is desirable.
https://bugzilla.gnome.org/show_bug.cgi?id=680760
g_utf8_strup() tries to call setlocale() before starting to compute
the length of its first argument. Calling setlocale() can return NULL
(as specified in the man page), and obviously that happens on android.
https://bugzilla.gnome.org/show_bug.cgi?id=680704
The old (length) annotation actually wasn't being read. Changing
it to an array was telling g-i that it was an array of utf8, which
is clearly not true.
We *could* add (element-type guint8), but that would change it to a
byte array, as opposed to the original utf8 version.
Just removing the annotation should bring us back to where we
were, which was fine.
https://bugzilla.gnome.org/show_bug.cgi?id=680310
gcontenttype.c was split into gcontenttype.c and gcontenttype-win32.c
in commit 32192ee9 ("Split gcontenttype.c"), so we don't want to include
gcontenttype.c in the Visual C++ build as it is no longer a source file
meant for Windows.
Thanks to Thomas H.P. Anderson for pointing this out.
Bug 680074 shows that we may end up in situations where only
some of the xlocale functions we need are available. Rather than
trying to find the minimal set of required functions for each
use, define a global USE_XLOCALE and only use any xlocale functions
if we have a full set.
Child sources are supposed to be blocked when their parents are, so
when adding a source to a blocked source, block the child too. Fixes a
warning when unblocking the parent.
Add a test that the decompressor input streams handle truncated data
correctly. (They do; I wrote the test thinking there was a bug there,
but there isn't.)
Also, rename the "corruption" tests to "roundtrip", since "corruption"
makes it sound like we're testing how the converters deal with
corrupted data, as opposed to merely testing that they don't corrupt
data themselves. And fix the bug reference.
Rather than implementing GCancellableSource by polling on its fd,
implement it by just waking its GMainContext up from the "cancelled"
signal handler, thereby helping to reduce file descriptor usage.
Suggested by Ryan Lortie.
https://bugzilla.gnome.org/show_bug.cgi?id=680121
* GCancellable can be "cancelled" more than once if
g_cancellable_reset() is called.
* Don't assume that because the "cancelled" signal fired
it won't fire again.
https://bugzilla.gnome.org/show_bug.cgi?id=680111
g_async_initable_real_init_finish() was previously handling all
GSimpleAsyncResults, even if they weren't created by
g_async_initable_real_init_async(), and libnm-glib accidentally relied
on that behavior. So remove the g_simple_async_result_is_valid()
check.
On Windows, GetEnvironmentVariable() returns 0 for empty variables.
Checking GetLastError() == ERROR_ENVVAR_NOT_FOUND helps make a
difference between a variable that does not exist or an empty one
which should return "".
https://bugzilla.gnome.org/show_bug.cgi?id=679617
The current code create the strv array incorrectly, it is too big and
leaves invalid holes. This may result in crashes when freeing the
returned value.
https://bugzilla.gnome.org/show_bug.cgi?id=679617