mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Fix dregister not being thread safe.
This commit is contained in:
parent
fdc41cac76
commit
395f7b29b4
1 changed files with 2 additions and 0 deletions
|
@ -30,8 +30,10 @@ extern "C" pthread_mutex_t __dirname_lock;
|
|||
|
||||
extern "C" void dregister(DIR* dir)
|
||||
{
|
||||
pthread_mutex_lock(&__dirname_lock);
|
||||
dir->flags |= _DIR_REGISTERED;
|
||||
if ( (dir->next = __firstdir) )
|
||||
dir->next->prev = dir;
|
||||
__firstdir = dir;
|
||||
pthread_mutex_unlock(&__dirname_lock);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue