• Debarshi Ray's avatar
    httpclient: Make the GCancellable handling thread-safe · e9114fe4
    Debarshi Ray authored
    A GCancellable can be cancelled from a different thread than the one
    where the GTask for the goa_http_client_check operation was created.
    Since the GCancellable::cancelled handler is invoked in the same thread
    as the g_cancellable_cancel call, unguarded access to the GError in
    CheckData is unsafe.
    
    Instead of introducing a GMutex, the GError can be set in the response
    callback which is guaranteed to be invoked in the same thread where the
    GTask was created. Ensuring that the GError is always accessed from the
    same thread makes it considerably easier to reason about its state.
    eg., it can be guaranteed that it won't be set if the status of the
    response isn't SOUP_STATUS_CANCELLED.
    e9114fe4
Name
Last commit
Last update
data Loading commit data...
doc Loading commit data...
m4 Loading commit data...
po Loading commit data...
src Loading commit data...
COPYING Loading commit data...
HACKING Loading commit data...
Makefile.am Loading commit data...
NEWS Loading commit data...
README Loading commit data...
autogen.sh Loading commit data...
configure.ac Loading commit data...
git.mk Loading commit data...
gnome-online-accounts.doap Loading commit data...
meson.build Loading commit data...
meson_options.txt Loading commit data...
meson_post_install.py Loading commit data...