Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • G GLib
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 859
    • Issues 859
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 35
    • Merge requests 35
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • GLib
  • Merge requests
  • !1713

gmain: g_main_context_check() can skip updating polled FD sources

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Claudio Saavedra requested to merge g_main_context_check_skipping_pollrec_updates into master Oct 21, 2020
  • Overview 19
  • Commits 1
  • Pipelines 6
  • Changes 2

If there is a file descriptor source that has a lower priority than the one for sources that are going to be dispatched, all subsequent file descriptor sources (internally sorted by file descriptor identifier) do not get an update in their GPollRec and later on wrong sources can be dispatched.

Fix this by first finding the first GPollRec that matches the current GPollFD, instead of relying on it to be the current one. Additionally add a few comments to explain how the iteration works.

Added a new test that reproduces the bug by creating two file descriptor sources and an idle one. Since the first file descriptor created has a lower identifier and a low priority, the second one is not dispatched even when it has the same, higher, priority as the idle source. After fixing this bug, both higher priority sources are dispatched as expected.

Fixes #1592 (closed)

Edited Oct 21, 2020 by Claudio Saavedra
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: g_main_context_check_skipping_pollrec_updates