Commit Graph

10117 Commits

Author SHA1 Message Date
Colin Walters
fdca8060aa build: Cache check for futex() and eventfd() 2011-06-21 23:28:52 -04:00
Colin Walters
fa87399280 GCancellable: Use Linux eventfd() instead of pipe
See commit f626dd2b4311bd82137c5b208ab2de288c3e6fae for rationale;
basically it's cheaper than a pipe.

https://bugzilla.gnome.org/show_bug.cgi?id=653140
2011-06-21 23:28:52 -04:00
Colin Walters
3904c8761a gmain: use Linux eventfd() for main context wake up
The Linux eventfd() call is basically tailor made for the main loop
wake up pipe - all we want is a threadsafe way to write to a file
descriptor, and wake up the context on the other end; we don't care
about the content at all.

The eventfd manual page basically explains the benefits:

       Applications can use an eventfd file descriptor instead of a
       pipe (see pipe(2)) in all cases where a pipe is used simply to
       signal events.  The kernel overhead of an eventfd file
       descriptor is much lower than that of a pipe, and only one file
       descriptor is required (versus the two required for a pipe).

When writing my multithreaded spawn test case I actually hit the 1024
file descriptor limit quickly, because we used 2 fds per main context.
This brings that down to 1.

https://bugzilla.gnome.org/show_bug.cgi?id=653140
2011-06-21 23:28:52 -04:00
Dan Winship
29bb7638a5 gio/Makefile.am: Remove stray references to $(marshal_sources) 2011-06-21 16:14:50 -04:00
Colin Walters
9053ad07ba Fix a srcdir!=builddir issue, and export that we support it
Future jhbuild versions will consume the BUILD API and automatically
use a builddir, so mark us as supporting it.
2011-06-21 10:30:07 -04:00
Fran Diéguez
3655178b14 Updated Galician translations 2011-06-21 13:55:31 +02:00
Philip Van Hoof
f6ed357101 Add iter_replace API to GHashTableIter
https://bugzilla.gnome.org/show_bug.cgi?id=652822
2011-06-20 23:05:59 -04:00
Matthias Clasen
8f05da99cb Make gmarshal.c actually compile standalone
It was lacking the necessary includes; in the past it has been
included towards the bottom of gsignal.c, and gained its includes
that way.
2011-06-20 22:49:34 -04:00
Colin Walters
b74e2a720a Stop using glib-genmarshal at build time
To help cross compilation, don't use glib-genmarshal in our
build.  This is easy now that we have g_cclosure_marshal_generic().

In gobject/, add gmarshal.[ch] to git (making the existing entry
points stubs).

In gio/, simply switch to using g_cclosure_marshal_generic().

https://bugzilla.gnome.org/show_bug.cgi?id=652168
2011-06-20 17:24:07 -04:00
David Zeuthen
322e25b535 GDBus: Unref worker from worker-thread to avoid race
... otherwise we might end up using the worker after it has been
freed. Reported by Dan Winship and Colin Walters.

This fix uncovered a bug in the /gdbus/nonce-tcp test case so "fix"
that as well to use a better way of having one thread wait for another
(using quotes for the word "fix" since it's pretty hackish to
busy-wait in one thread to wait for another).

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-06-20 16:32:03 -04:00
Colin Walters
4344838781 gthread tests: Remove spurious return; 2011-06-20 14:09:50 -04:00
Colin Walters
5e64717a5f gclosure: Add G_TYPE_ENUM and G_TYPE_PARAM for g_cclosure_marshal_generic()
These are fundamental types missed in the original commit.
2011-06-20 14:03:05 -04:00
Colin Walters
d54c65448c gdbus-test-codegen: Allocate full integer space for uint16 properties
Because there is no G_TYPE_[U]INT16, we need to use integer types,
otherwise we'll end up overwriting memory (in this case on the stack).
2011-06-20 14:03:05 -04:00
Javier Jardón
49fac943f3 configure.ac: Generate xz tarballs by default 2011-06-20 11:49:40 +01:00
Chun-wei Fan
c68683f780 Visual C++ 2010 project files update
Consolidate my previous commit into property file... should have realized
this sooner...
2011-06-20 11:50:57 +08:00
Chun-wei Fan
801e52f809 Update Visual C++ 2010 Projects
-Seperate intermediate directories for each project to avoid intermittent
 MSBuild errors that a build log cannot be written while in use, and
 update the property sheet as necessary.
-Minor cleanups of uneeded tags in the projects/properties
2011-06-20 11:34:15 +08:00
Christian Persch
f9cec26968 Clarify nul-termination of g_utf8_to_ucs4[_fast] result
The docs for g_utf8_to_ucs4_fast didn't mention that the resulting
string is terminated by a 0 character.

Bug #652897.
2011-06-19 13:14:39 +02:00
Matthias Clasen
580e177dcc Add tests for GCache 2011-06-19 01:42:48 -04:00
Matthias Clasen
9fa5b8e5c7 asyncqueue: improve test coverage 2011-06-19 01:05:26 -04:00
Matthias Clasen
63fa44251a utils: silence tests unless verbose 2011-06-19 01:05:05 -04:00
Matthias Clasen
e1d4e06ab3 logging: improve test coverage 2011-06-19 01:04:48 -04:00
Matthias Clasen
ed3ac87afe hash: Improve test coverage 2011-06-19 01:04:30 -04:00
Chun-wei Fan
c4796a4d7a Update gsettings/glib-compile-schemas VS Projects
These tools require the use of GModule headers also, so update the include
directories so that the correct gmodule.h will be included instead of the
system-installed version.
2011-06-18 17:55:58 +08:00
Colin Walters
4476e22a14 gvariant: Mark g_variant_new_variant as constructor
https://bugzilla.gnome.org/show_bug.cgi?id=647796
2011-06-17 09:39:48 -04:00
Colin Walters
19610184c4 gdatainputstream: Add Since: tags and update gio-sections.txt
https://bugzilla.gnome.org/show_bug.cgi?id=652758
2011-06-17 08:52:23 -04:00
Colin Walters
28254a38a7 GDataInputStream: Add _utf8() variants of _read_line
These will validate the resulting line, and throw a conversion error.
In practice these will likely be used by bindings, but it's good
for even C apps too that don't want to explode if that text file
they're reading into Pango actually has invalid UTF-8.

https://bugzilla.gnome.org/show_bug.cgi?id=652758
2011-06-16 20:03:02 -04:00
Colin Walters
ff2f46a7f4 GDataInputStream: Clarify read_line() docs, mark as byte array
g_data_input_stream_read_line() and
g_data_input_stream_read_line_finish() don't do any encoding checks,
so we shouldn't call the returned value a "string" (which I'd like to
mean UTF-8).  Annotate them as byte arrays and add encoding warnings
to the docstrings.

https://bugzilla.gnome.org/show_bug.cgi?id=652758
2011-06-16 20:00:02 -04:00
Patrick Welche
de0519581a Fix build due to trivial typos in ab0e9dbf.
https://bugzilla.gnome.org/show_bug.cgi?id=652750
2011-06-16 13:09:42 -04:00
Murray Cumming
34b7126a4e G_STATIC_REC_MUTEX_INIT: Add a 0 to the initialization.
This avoids a compiler warning about an incomplete initialization
when using this.
2011-06-15 10:47:13 +02:00
Ryan Lortie
23f684454f Drop dead code in GVariant parser
There is no chance that an unsigned integer value will be negative after
we do the bounds check that enforces its non-negativity.

Caught by Matthias running Coverity.
2011-06-14 22:45:06 -04:00
Matthias Clasen
a6b9db6907 Eliminate some dead code 2011-06-14 21:06:17 -04:00
Matthias Clasen
9b68d9892a Remove a redundant NULL check 2011-06-14 21:06:17 -04:00
Matthias Clasen
28008138c3 Silence a compiler warning 2011-06-14 21:06:17 -04:00
Matthias Clasen
f966a0af9a Add some argument checks to filename conversion functions 2011-06-14 21:06:16 -04:00
Colin Walters
c9f883f133 gmain: Close race condition in _g_main_wake_up_all_contexts()
Running gthread/tests/spawn-multithreaded in a loop, I very easily hit:

GLib-CRITICAL **: g_main_context_wakeup: assertion `g_atomic_int_get (&context->ref_count) > 0' failed

Testing the refcount still left a window where we would fall into the
assertion.  Fix this by just locking the context.
2011-06-14 19:23:36 -04:00
Colin Walters
211d7adf6e gmain: Only run through signal delivery once per read()
This is what I intended to do before.

https://bugzilla.gnome.org/show_bug.cgi?id=652072
2011-06-14 19:23:36 -04:00
Colin Walters
ed827deb77 gmain: Use sigset_t for keeping track of installed signals
Minor code cleanup.

https://bugzilla.gnome.org/show_bug.cgi?id=652072
2011-06-14 19:23:36 -04:00
Colin Walters
1874ad97d8 gspawn: Reset signal handlers for synchronous spawning
We should by default reset signal handlers; particularly with the
ability to install them via g_unix_signal_source_new(), we don't
want to call a user callback inside a fork()ed helper process.

https://bugzilla.gnome.org/show_bug.cgi?id=652072
2011-06-14 19:23:36 -04:00
Colin Walters
b9c67b4369 glib/tests/unix.c: Also test SIGTERM
We expect this to not kill the process, so it'd be a good one to test.

https://bugzilla.gnome.org/show_bug.cgi?id=652072
2011-06-14 19:23:36 -04:00
Colin Walters
c2364ce9a4 spawn-multithreaded: Clean up IO channel code
I modeled the new bits after how gunixmount.c handles GIOChannel;
it's apparently easier not to look at the condition.

https://bugzilla.gnome.org/show_bug.cgi?id=652072
2011-06-14 19:23:36 -04:00
Colin Walters
7e1886ba72 gspawn: Handle EINTR in a few more cases
I was debugging gthread/tests/spawn-multithreaded.c, and while I
don't think I actually hit EINTR in any of these cases, it'd be
good to fix them anyways.

https://bugzilla.gnome.org/show_bug.cgi?id=652072
2011-06-14 19:23:35 -04:00
Colin Walters
922f6aa496 spawn-singlethread.c: New test
https://bugzilla.gnome.org/show_bug.cgi?id=652072
2011-06-14 19:23:35 -04:00
Colin Walters
01ee9449e3 spawn-multithreaded: Also look for lt-test-echo
I hate libtool =(

https://bugzilla.gnome.org/show_bug.cgi?id=652072
2011-06-14 19:23:35 -04:00
Matthias Clasen
b6a829c314 If dup fails don't call close() 2011-06-14 18:51:57 -04:00
Matthias Clasen
6e7a7052e0 Remove a redundant assertion
A gsize is never going below 0.
2011-06-14 18:51:57 -04:00
Matthias Clasen
ba6e66bff1 Don't compare unsigned numbers with 0
It does not work.
2011-06-14 18:51:57 -04:00
David Zeuthen
a6d33d3a28 GDBusMessage: Optimize serializer and deserializer
... by using a switch instead of if-then-else.

Signed-off-by: David Zeuthen <davidz@redhat.com>
2011-06-14 18:12:04 -04:00
Colin Walters
7963a4cf95 gclosure: Add missing include 2011-06-14 12:28:57 -04:00
Matthias Clasen
01e6cf1360 Don't do < 0 on an unsigned value
It won't work. read() returns a signed value, anyway.
2011-06-14 11:40:32 -04:00
Matthias Clasen
25a797fa25 Silence a compiler warning
Even though we are confident the filename will always
end in .gmarkup, the compiler doesn't know that...
2011-06-14 10:16:35 -04:00