1
0
Fork 0
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:
Jonas 'Sortie' Termansen 2014-08-04 19:10:14 +02:00
parent fdc41cac76
commit 395f7b29b4

View file

@ -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);
}