1. 22 Feb, 2019 1 commit
  2. 06 Feb, 2019 1 commit
    • Debarshi Ray's avatar
      gtask: Return cancelled tasks asynchronously · 6f3d57d2
      Debarshi Ray authored
      Once cancelled, a GTask's callback should not only be invoked
      asynchronously with respect to the creation of the task, but also with
      respect to the GCancellable::cancelled handler. This is particularly
      relevant in cases where the cancellation happened in the same thread
      where the task is running.
      Spotted by Dan Winship and Michael Catanzaro.
      Closes #1608
  3. 05 Jan, 2019 1 commit
    • Philip Withnall's avatar
      gtask: Ensure to return 1 or 0 from getters rather than truthy ints · ae381d79
      Philip Withnall authored
      Since commit 290bb0dd, where various members of GTask were converted to
      a bitfield, some of the getters:
       • g_task_get_check_cancellable()
       • g_task_get_return_on_cancel()
       • g_task_get_completed()
      have been returning truthy ints (zero or an arbitrary non-zero integer)
      as boolean values, rather than the canonical boolean ints of 1 and 0.
      This broke the `yield` statement in Vala, whose generated C code
      compares `g_task_get_completed (…) != TRUE`. i.e. Whether the
      `completed` field has a value not equal to 1.
      Fix this by explicitly converting truthy ints to canonical boolean ints
      in all getters.
      Signed-off-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
  4. 30 Oct, 2018 1 commit
    • Philip Withnall's avatar
      gtask: Add a g_task_set_name() method · e89128a9
      Philip Withnall authored
      Similarly to g_source_set_name(), this sets a name on a GTask for
      debugging and profiling. Importantly, this name is propagated to the
      GSource for idle callbacks for the GTask, ending the glorious reign of
      `[gio] complete_in_idle_cb`.
      The name can be queried using g_task_get_name(). Locking is avoided by
      only allowing the name to be set before the GTask is used from another
      Includes tests.
      Signed-off-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
  5. 02 Oct, 2018 1 commit
    • Philip Withnall's avatar
      gtask: Compress GTask struct using a bitfield · 290bb0dd
      Philip Withnall authored
      There are a lot of gbooleans in the private GTask struct, which seems a
      bit wasteful. Use a bitfield to compress the struct a bit.
      This reduces the size of the struct from 216 bytes to 168 bytes on my
      64-bit machine.
      One of the fields needs to remain separate, since it’s used from a
      TRACE() macro which calls typeof() on it.
      Signed-off-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>
  6. 01 Oct, 2018 1 commit
  7. 08 Aug, 2018 1 commit
  8. 26 Jun, 2018 1 commit
    • Philip Withnall's avatar
      gmain: Add names to various GSources constructed in GLib · 208a6e81
      Philip Withnall authored
      For the purposes of debugging, it is quite useful for every GSource to
      have a name set. Ensure that any GSource we construct inside GLib has a
      name set. For GSources which are then returned to the caller, this name
      can then be overridden with something even more useful by the caller.
      Since this data is only used for debugging, avoid doing any allocations
      for it; just use static strings.
  9. 07 Nov, 2017 1 commit
  10. 26 Oct, 2017 1 commit
  11. 11 Oct, 2017 1 commit
  12. 29 May, 2017 1 commit
  13. 22 Nov, 2016 2 commits
  14. 15 Jun, 2016 1 commit
  15. 04 May, 2016 1 commit
  16. 30 Apr, 2016 1 commit
  17. 16 Nov, 2015 1 commit
  18. 02 Nov, 2015 1 commit
  19. 24 Oct, 2015 1 commit
  20. 29 Jun, 2015 2 commits
  21. 04 Apr, 2015 1 commit
    • Dan Winship's avatar
      gtask: remove hardcoded GTask thread-pool size · 86866a2a
      Dan Winship authored
      GTask used a 10-thread thread pool for g_task_run_in_thread() /
      g_task_run_in_thread_sync(), but this ran into problems when task
      threads blocked waiting for another g_task_run_in_thread_sync()
      operation to complete. Previously there was a workaround for this, by
      bumping up the thread limit when that case was detected, but deadlocks
      could still happen if there were non-GTask threads involved. (Eg, task
      A sends a message to thread X and waits for a response, but thread X
      needs to complete task B in a thread before returning the response to
      task A.)
      So, allow GTask's thread pool to be expanded dynamically, by watching
      it from the glib worker thread, and growing it (at an
      exponentially-decreasing rate) if too much time passes without any
      tasks completing. This should solve the deadlocking problems without
      causing sudden breakage in apps that assume they can queue huge
      numbers of tasks at once without consequences.
  22. 10 Mar, 2015 1 commit
    • Philip Withnall's avatar
      gtask: Add a GTask:completed property · 4f1f68e6
      Philip Withnall authored
      This can be used to query whether the task has completed, in the sense
      that it has had a result set on it, and has already – or will soon –
      invoke its callback function.
      Notifications for this property are emitted immediately after the task’s
      main callback, in the same main context as that callback. This allows
      for multiple bits of code to listen for completion of the GTask, which
      opens the door for blocking on cancellation of the GTask and improved
      handling of ‘pending’ behaviour.
  23. 23 Sep, 2014 3 commits
  24. 09 Jul, 2014 1 commit
  25. 27 Mar, 2014 1 commit
  26. 20 Feb, 2014 1 commit
  27. 15 Feb, 2014 1 commit
    • Matthias Clasen's avatar
      docs: let go of &ast; · bc6ee788
      Matthias Clasen authored
      Since we are no longer using sgml mode, using /&ast; &ast;/ to
      escape block comments inside examples does not work anymore.
      Switch to using line comments with //
  28. 13 Feb, 2014 1 commit
  29. 08 Feb, 2014 1 commit
  30. 06 Feb, 2014 1 commit
  31. 01 Feb, 2014 5 commits
  32. 31 Jan, 2014 1 commit