Skip to content
Snippets Groups Projects
Commit ba95524c authored by Avi Kivity's avatar Avi Kivity
Browse files

sched: add 'pinned' attribute to threads

parent 5061b5af
No related branches found
No related tags found
No related merge requests found
......@@ -53,7 +53,8 @@ void thread::switch_to_first()
void thread::init_stack()
{
void** stacktop = reinterpret_cast<void**>(_stack.begin + _stack.size);
auto& stack = _attr.stack;
void** stacktop = reinterpret_cast<void**>(stack.begin + stack.size);
*--stacktop = this;
*--stacktop = reinterpret_cast<void*>(thread_main);
_state.rsp = stacktop;
......
......@@ -109,7 +109,7 @@ thread::thread(std::function<void ()> func, attr attr, bool main)
: _func(func)
, _on_runqueue(!main)
, _waiting(false)
, _stack(attr.stack)
, _attr(attr)
, _terminated(false)
, _joiner()
{
......@@ -197,7 +197,7 @@ void thread::join()
thread::stack_info thread::get_stack_info()
{
return _stack;
return _attr.stack;
}
timer_list::callback_dispatch::callback_dispatch()
......
......@@ -61,6 +61,7 @@ public:
};
struct attr {
stack_info stack;
bool pinned;
};
public:
......@@ -93,7 +94,7 @@ private:
thread_control_block* _tcb;
bool _on_runqueue;
std::atomic_bool _waiting;
stack_info _stack;
attr _attr;
cpu* _cpu;
bool _terminated;
bi::list<timer> _active_timers;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment