Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wakeup_remove #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Calvin-LL
Copy link

@Calvin-LL Calvin-LL commented Dec 9, 2022

Hi, I found this bug while working on the class project in @achreto's class at UBC.

Consider this code snippet:

struct dcb *dcb = ...;
wakeup_set(dcb, 3);
wakeup_remove(dcb);
wakeup_set(dcb, 4);

The second call to wakeup_set would cause this assertion to fail

assert(kcb_current->wakeup_queue_head == dcb);

The function uses dcb->wakeup_time to tell if a dcb is on the wakeup queue but doesn't set it back to 0 when removing a dcb. This PR fixes that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant