pipe: fix unlocking lock that is not owned

This commit is contained in:
Matheus
2022-10-18 12:45:38 -03:00
parent b9e1f85486
commit a1b84f9335
+2
View File
@@ -42,6 +42,7 @@ int pipe_read(pipe_t* pipe, void* buff, size_t count, int* error){
spinlock_release(&pipe->lock);
if(event_wait(&pipe->wevent, true)){
spinlock_acquire(&pipe->lock);
readc = -1;
*error = EINTR;
break;
@@ -80,6 +81,7 @@ int pipe_write(pipe_t* pipe, void* buff, size_t count, int* error){
spinlock_release(&pipe->lock);
if(event_wait(&pipe->revent, true)){
spinlock_acquire(&pipe->lock);
*error = EINTR;
writec = -1;
break;