A racing condition is fixed in JIT reported by Mozilla.

This commit is contained in:
Zoltán Herczeg 2016-05-19 18:09:07 +00:00
parent 8f4e7c84b4
commit 7650161677
2 changed files with 6 additions and 1 deletions

View File

@ -106,6 +106,8 @@ additions).
"private" knowledge of the data structures. This is unnecessary; the code has
been re-factored and no longer includes pcre2_internal.h.
25. A racing condition is fixed in JIT reported by Mozilla.
Version 10.21 12-January-2016
-----------------------------

View File

@ -182,7 +182,10 @@ static pthread_mutex_t dev_zero_mutex = PTHREAD_MUTEX_INITIALIZER;
static SLJIT_INLINE sljit_s32 open_dev_zero(void)
{
pthread_mutex_lock(&dev_zero_mutex);
dev_zero = open("/dev/zero", O_RDWR);
/* The dev_zero might be initialized by another thread during the waiting. */
if (dev_zero < 0) {
dev_zero = open("/dev/zero", O_RDWR);
}
pthread_mutex_unlock(&dev_zero_mutex);
return dev_zero < 0;
}