#include "sched/scheduler.h"
#include "util/die.h"

void lwt_scheduler_loop()
{
	for(;;) {
		scheduler.waitReadySem();

		lwt::Thread *thread = scheduler.getNext();
		thread->func(thread->ptr1, thread->ptr2);
		lwt::Alloc::free(thread);
	}
}
