events: finish implementation

This commit is contained in:
Matheus
2022-09-04 18:01:09 -03:00
parent 4c0ee7179e
commit ad182d3872
2 changed files with 2 additions and 7 deletions
+2 -2
View File
@@ -49,7 +49,7 @@ int event_wait(event_t* event, bool interruptible){
addtoevent(thread, event); addtoevent(thread, event);
// ... sched_block(interruptible);
int ret = 0; int ret = 0;
@@ -87,7 +87,7 @@ int event_signal(event_t* event, bool interruptson){
if(!thread) if(!thread)
continue; continue;
// ... sched_eventsignal(event, thread);
} }
-5
View File
@@ -297,10 +297,6 @@ void sched_block(bool interruptible){
thread_t* thread = arch_getcls()->thread; thread_t* thread = arch_getcls()->thread;
spinlock_acquire(&queues[thread->priority].lock);
queue_remove(&queues[thread->priority], thread);
spinlock_release(&queues[thread->priority].lock);
thread->state = interruptible ? THREAD_STATE_BLOCKED_INTR : THREAD_STATE_BLOCKED; thread->state = interruptible ? THREAD_STATE_BLOCKED_INTR : THREAD_STATE_BLOCKED;
sched_yield(); sched_yield();
@@ -314,7 +310,6 @@ void sched_init(){
timer_req* req = &arch_getcls()->schedreq; timer_req* req = &arch_getcls()->schedreq;
req->func = sched_timerhook; req->func = sched_timerhook;
} }
void sched_runinit(){ void sched_runinit(){