kernel: Remove Thread::next_state

This commit is contained in:
Pawel Dziepak
2013-11-29 19:31:10 +01:00
parent c19f1e4fbb
commit 2b7ea4cddf
9 changed files with 23 additions and 32 deletions
+2 -2
View File
@@ -43,7 +43,7 @@ void scheduler_reschedule_ici(void);
indefinitely, the function will eventually return.
The caller must hold the current thread \c scheduler_lock.
*/
void scheduler_reschedule(void);
void scheduler_reschedule(int32 next_state);
/*! Sets the given thread's priority.
The thread may be running or may be in the ready-to-run queue.
@@ -112,7 +112,7 @@ static inline void
scheduler_reschedule_if_necessary_locked()
{
if (gCPU[smp_get_current_cpu()].invoke_scheduler)
scheduler_reschedule();
scheduler_reschedule(B_THREAD_READY);
}
+1 -1
View File
@@ -211,7 +211,7 @@ thread_is_interrupted(Thread* thread, uint32 flags)
static inline bool
thread_is_blocked(Thread* thread)
{
return thread->wait.status == 1;
return atomic_get(&thread->wait.status) == 1;
}
-1
View File
@@ -424,7 +424,6 @@ struct Thread : TeamThreadIteratorEntry<thread_id>, KernelReferenceable,
int32 priority; // protected by scheduler lock
int32 io_priority; // protected by fLock
int32 state; // protected by scheduler lock
int32 next_state; // protected by scheduler lock
struct cpu_ent *cpu; // protected by scheduler lock
struct cpu_ent *previous_cpu; // protected by scheduler lock
int32 pinned_to_cpu; // only accessed by this thread or in the