implement thread_get_nice, thread_set_nice and skeleton for calculate_priority
This commit is contained in:
@@ -364,19 +364,27 @@ thread_get_priority (void)
|
|||||||
return thread_current ()->priority;
|
return thread_current ()->priority;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Calculates priority for the current thread */
|
||||||
|
int
|
||||||
|
calculate_priority (void)
|
||||||
|
{
|
||||||
|
/* Not yet implemented */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Sets the current thread's nice value to NICE. */
|
/* Sets the current thread's nice value to NICE. */
|
||||||
void
|
void
|
||||||
thread_set_nice (int nice UNUSED)
|
thread_set_nice (int nice)
|
||||||
{
|
{
|
||||||
/* Not yet implemented. */
|
thread_current ()->nice = nice;
|
||||||
|
calculate_priority ();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns the current thread's nice value. */
|
/* Returns the current thread's nice value. */
|
||||||
int
|
int
|
||||||
thread_get_nice (void)
|
thread_get_nice (void)
|
||||||
{
|
{
|
||||||
/* Not yet implemented. */
|
return thread_current ()->nice;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns 100 times the system load average. */
|
/* Returns 100 times the system load average. */
|
||||||
|
|||||||
Reference in New Issue
Block a user