apio
1c12cf016e
Finally. Just Round Robin with sleeping, but it's still awesome. I think this can finish v0.3, with a few adjustments.
12 lines
254 B
C++
12 lines
254 B
C++
#include "thread/Task.h"
|
|
#include "std/string.h"
|
|
|
|
void set_context_from_task(Task& task, Context* ctx)
|
|
{
|
|
memcpy(ctx, &task.regs, sizeof(Context));
|
|
}
|
|
|
|
void get_context_to_task(Task& task, Context* ctx)
|
|
{
|
|
memcpy(&task.regs, ctx, sizeof(Context));
|
|
} |