Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
K
kernel
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 20
    • Issues 20
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 4
    • Merge Requests 4
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • redox-os
  • kernel
  • Merge Requests
  • !108

Open
Opened Aug 02, 2019 by 0x2Adr1@0x2Adr11
  • Report abuse
Report abuse

Context switch: Remove duplicated logic to find the next context

We first try to find a context that has a pid greater than the current context. If no such context exists, we go through the list of context again to find a runnable context with a lower pid.

In this change we refactor the code that was almost identical and we cache the first runnable context with a lower pid to avoid going through the context list a second time if no runnable context with greater pid was found.

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

-# All repo/branch refs have been quoted to allow support for special characters (such as #my-branch)
git fetch "https://gitlab.redox-os.org/0x2Adr1/kernel.git" "refactor_switch"
git checkout -b "0x2Adr1/kernel-refactor_switch" FETCH_HEAD

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git fetch origin
git checkout "origin/master"
git merge --no-ff "0x2Adr1/kernel-refactor_switch"

Step 4. Push the result of the merge to GitLab

git push origin "master"

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

  • Discussion 0
  • Commits 1
  • Changes 1
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
0
Labels
None
Assign labels
  • View project labels
Reference: redox-os/kernel!108