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:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user