mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-28 05:08:22 +00:00
pipe: fix unlocking lock that is not owned
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user