cleanup: replace magic TimeSlice::new(100) and Priority::new(16) with DEFAULT
TimeSlice::DEFAULT and Priority::DEFAULT already exist with the same values. Using them makes the intent clear and centralizes the default values. TimeSlice::new(2) in tick test is intentional — tests preemption after 2 ticks specifically.
This commit is contained in:
@@ -15,7 +15,7 @@ impl<P: Platform> Kernel<P> {
|
||||
use domain::thread::SavedContext;
|
||||
|
||||
let priority = types::bounded::Priority::DEFAULT;
|
||||
let time_slice = types::time::TimeSlice::new(100);
|
||||
let time_slice = types::time::TimeSlice::DEFAULT;
|
||||
let context = SavedContext::with_entry_and_stack(entry, stack);
|
||||
|
||||
let tid = match self.threads.spawn_with_context(pid, priority, time_slice, None, context) {
|
||||
@@ -99,7 +99,7 @@ impl<P: Platform> Kernel<P> {
|
||||
};
|
||||
|
||||
let priority = types::bounded::Priority::DEFAULT;
|
||||
let time_slice = types::time::TimeSlice::new(100);
|
||||
let time_slice = types::time::TimeSlice::DEFAULT;
|
||||
let context = SavedContext::with_entry_and_stack(entry, stack);
|
||||
|
||||
let tid = match self.threads.spawn_with_context(target_pid, priority, time_slice, None, context) {
|
||||
|
||||
Reference in New Issue
Block a user