Added functions to pin a thread to the current CPU (i.e. it will only be

scheduled on that CPU) and to avoid unscheduling it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27974 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2008-10-11 18:11:12 +00:00
parent c4c2a6192d
commit 6503e5d9c6
4 changed files with 48 additions and 3 deletions
+28
View File
@@ -205,4 +205,32 @@ thread_interrupt(struct thread* thread, bool kill)
}
static inline void
thread_pin_to_current_cpu(struct thread* thread)
{
thread->pinned_to_cpu++;
}
static inline void
thread_unpin_from_current_cpu(struct thread* thread)
{
thread->pinned_to_cpu--;
}
static inline void
thread_disable_scheduling(struct thread* thread)
{
thread->keep_scheduled++;
}
static inline void
thread_enable_scheduling(struct thread* thread)
{
thread->keep_scheduled--;
}
#endif /* _THREAD_H */