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);
// ...
sched_block(interruptible);
int ret = 0;
@@ -87,7 +87,7 @@ int event_signal(event_t* event, bool interruptson){
if(!thread)
continue;
// ...
sched_eventsignal(event, thread);
}
-5
View File
@@ -296,10 +296,6 @@ void sched_eventsignal(event_t* event, thread_t* thread){
void sched_block(bool interruptible){
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;
@@ -314,7 +310,6 @@ void sched_init(){
timer_req* req = &arch_getcls()->schedreq;
req->func = sched_timerhook;
}
void sched_runinit(){