-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pause_proc_timer][1/n] Introduce ErtsPausedProcTimer type and operat…
…ions We want a way to "pause" a proc timer when suspending a process, and "resume" it later. We will do this as follows. * Pausing a proc timer means: 1. Cancelling the current timer in `common.timer`, if any. 2. Storing in `common.timer` instead how much time was left in the timer. To compute the time left, we need to inspect the current timer. 3. Flagging in the `Process` struct that the timer is paused. This is so that we know later that we need to resume the timer when resuming the process. * Resuming a proc timer then amounts to: 1. Creating a new proc timer based on the time left that was stored in `common.timer`. 2. Clear all the flags in the `Process` struct * When cancelling a proc timer, we now need to check if it is paused (in which case, it can just be ignored) So here we introduce a `ErtsPausedProcTimer` type, that will contain the time remaining on a paused timer, and a header that is shared with all other timer types (so that we can safely insert it in `common.timer`). We also introduce the functions to pause a proc timer and resume it. At this point nothing calls these functions, this happens in the next commits.
- Loading branch information
1 parent
187a6be
commit 825ddd3
Showing
3 changed files
with
116 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters