2005-08-04 Matthias Clasen <mclasen@redhat.com>
* glib/glib.symbols:
* glib/gatomic.[hc]: Always export g_atomic_int_get and
g_atomic_pointer_get as functions, even if we have macros,
to avoid changing the ABI depending on configuration.
* glib/gatomic.c: Fix the s390 implementations of
g_atomic_pointer_compare_and_exchange.
2005-08-04 Tor Lillqvist <tml@novell.com>
* glib/gstdio.h: Move the G_BEGIN_DECLS/G_END_DECLS pair outside
the #if/#else/#endif block. Otherwise we had G_BEGIN_DECLS without
matching G_END_DECLS on Unix, and G_END_DECLS without matching
G_BEGIN_DECLS on Win32.
2005-08-02 Matthias Clasen <mclasen@redhat.com>
* glib/gconvert.c (g_convert_with_iconv): Don't go in an
infinite loop if the input text ends in an incomplete multibyte
character. (#312402, Sebastian Bacher)
2005-08-02 Tor Lillqvist <tml@novell.com>
* tests/refcount/objects.c
* tests/refcount/properties.c
* tests/refcount/signals.c: Use g_usleep() instead of sleep() for
portability.
Mon Aug 1 23:33:47 2005 Tim Janik <timj@imendio.com>
* tests/refcount/closures.c: test high contention on closure
reference counts to trigger and catch non-atomic updates.
* tests/refcount/objects.c:
* tests/refcount/objects2.c:
* tests/refcount/properties.c:
* tests/refcount/properties2.c:
* tests/refcount/signals.c:
fixed up test and threading fundamentals. variables accessed from all
threads need to be volatile. context switches are enforced by using
g_thread_yield(), not g_usleep(1) which may result in busy waits on
some platforms. for testcode, always consider all warnings and
critical messages fatal. issue the currently running program on
stdout. improved progress indicators.
* tests/refcount/properties.c:
* tests/refcount/objects.c:
don't overdo the number of testing threads to keep the testing machine
usable, 2 threads can produce as much contention as 20 if executing the
same code.
* tests/refcount/signals.c: only start 1 thread per object. GObject
doesn't provide mutually exclusive object access, but only mutually
exclusive reference count modification.
* tests/Makefile.am: added closures test.
2005-08-01 Tor Lillqvist <tml@novell.com>
* tests/uri-test.c: Make it pass on Win32.
(from_uri_tests[]): Take into consideration that on Win32 we don't
return "localhost" hostnames.
(safe_strcmp_filename): New function that considers slash and
backslash equal on Win32.
(run_roundtrip_tests): Use safe_strcmp_filename().
Sun Jul 31 01:50:20 2005 Tim Janik <timj@gtk.org>
* glib/gdataset.c:
moved G_DATALIST_*_POINTER() macros here, because proper use requires
the global g_dataset_global mutex to be acquired.
g_datalist_id_get_data():
g_datalist_unset_flags():
g_datalist_set_flags(): properly acquire and release dataset mutex.
* glib/gdatasetprivate.h: implement G_DATALIST_GET_FLAGS() via atomic
pointer access to account for memory barriers. moved all other macros.
2005-07-26 Matthias Clasen <mclasen@redhat.com>
* configure.in: Try -mt as compiler flag for threads, needed
for the HP C compiler on HP-UX. (#163051, Paul Cornett)
2005-07-20 Matthias Clasen <mclasen@redhat.com>
* glib/gthreadpool.c (g_thread_pool_free): Don't get
stuck in here if immediate is TRUE. (#310954,
Hong Jen Yee)
* tests/threadpool-test.c (main): Test immediate == TRUE.
2005-07-20 Tor Lillqvist <tml@novell.com>
* glib/gutils.h (g_win32_get_system_data_dirs): Make this an
inline function. Define it only if G_CAN_INLINE and not
C++. (#173098)
2005-07-19 Matthias Clasen <mclasen@redhat.com>
* glib/gstring.c (g_string_chunk_insert_len): Avoid
an unnecessary strlen if len is -1. (#169692,
Benoit Dejean)
2005-07-15 Matthias Clasen <mclasen@redhat.com>
Make refcounting threadsafe by using atomic
operations. (#166020, Wim Taymans)
* gobject.c: Use a recursive lock to protect the
notify queue.
(g_object_unref): Get rid of g_object_last_unref and
do the last unref handling in g_object_unref.
(g_object_ref, g_object_unref): Use atomic operations.
* gsignal.c (struct _HandlerMatch): Use a full integer
for the ref_count field.
(handler_ref, handler_unref_R): Use atomic operations.
* gparam.c (g_param_spec_ref, g_param_spec_unref):
Use atomic operations instead of a lock to make the
refcounting threadsafe.
* gclosure.c (g_closure_ref, g_closure_unref): Use atomic
operations. This is more complicated here, since the
refcount is stored in a bitfield, so we also have
to access all other bitfield members atomically.
* gsignal.c (handlers_find): Read the meta_marshal flag
of the closure atomically.
* tests/Makefile.am (SUBDIRS): Add tests/refcount
* configure.in: Add tests/refcount
* tests/refcount/properties.c: Test property changes
from multiple threads.
* tests/refcount/signals.c: Test signal emission from
multiple threads.
* tests/refcount/objects.c: Test refcounting from
multiple threads.
* tests/refcount/objects2.c:
* tests/refcount/properties2.c: Tests to measure the
overhead of threadsafe refcounting.
* glib/giochannel.c (g_io_channel_ref, g_io_channel_unref):
Use atomic operations to make refcounting
threadsafe. (#166020, Wim Taymans)
2005-07-12 Matthias Clasen <mclasen@redhat.com>
* glib/goption.h (G_OPTION_FLAG_NOALIAS):
* glib/goption.c: Add and implement a new flag
to turn off the automatic <groupname>- prefixing
for conflict resolution of long option names. (#171840,
Adam McLaurin)
All optional callback arguments (#308886, Pawel
Sliwowski)
* glib/goption.h (G_OPTION_FLAG_OPTIONAL_ARG):
* glib/goption.c: Add and implement a new flag
to indicate that a callback *optionally* takes another
argument.
* tests/option-test.c: Add tests for optional arguments.
2005-07-10 Matthias Clasen <mclasen@redhat.com>
* glib/gutils.c (g_listenv): Ignore anomalous environment
entries which are not of the form variable=value. (#309859,
Morten Welinder)
2005-07-09 Tor Lillqvist <tml@novell.com>
* configure.in: Don't use autoconf variables for the resource
object files on Win32 any longer. Instead handle that in the
Makefile.am files. Check for windres.
* glibconfig.h.win32.in: Minor tuning to match the
configure-produced glibconfig.h closely.
* */Makefile.am: Don't use the scripts in build/win32 to
compile the .rc file into a resource object file. (This means
we loose the build number increment magic, but I doubt it was
that useful anyway.) Instead use windres directly. To pass the
normal .o file produced by windres through libtool, which
wants .lo files, pass it directly to the linker using a -Wl
option.
* */*.rc.in: Thus replace BUILDNUMBER with 0.
2005-07-01 Hans Breuer <hans@breuer.org>
* glib/gmessages.c : include <process.h> for getpid()
* glib/gmappedfile.c : include <io.h> for close() etc.
* glib/makefile.msc.in : add gmappedfile.obj
2005-07-01 Matthias Clasen <mclasen@redhat.com>
* glib/gkeyfile.c (g_key_file_get_key_comment):
(g_key_file_get_top_comment): Don't reverse the order of multiline
comments.
(g_key_file_get_group_comment): Actually get the group comment.
* tests/keyfile-test.c (test_comments): Test that comments are
handled properly. (#309263, Mikael Magnusson)
2005-07-01 Matthias Clasen <mclasen@redhat.com>
* tests/keyfile-test.c (test_comments): Test that comments are
handled properly. (#309263, Mikael Magnusson)