implement thread_get_nice & thread_get_recent_cpu
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include <random.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "threads/fixed-point.h"
|
||||
#include "threads/flags.h"
|
||||
#include "threads/interrupt.h"
|
||||
#include "threads/intr-stubs.h"
|
||||
@@ -399,8 +400,7 @@ thread_get_load_avg (void)
|
||||
int
|
||||
thread_get_recent_cpu (void)
|
||||
{
|
||||
/* Not yet implemented. */
|
||||
return 0;
|
||||
return fp_round (fp_mul_int (thread_current ()->recent_cpu, 100));
|
||||
}
|
||||
|
||||
/* Idle thread. Executes when no other thread is ready to run.
|
||||
|
||||
Reference in New Issue
Block a user