A racing condition is fixed in JIT reported by Mozilla.
This commit is contained in:
parent
8f4e7c84b4
commit
7650161677
|
@ -106,6 +106,8 @@ additions).
|
||||||
"private" knowledge of the data structures. This is unnecessary; the code has
|
"private" knowledge of the data structures. This is unnecessary; the code has
|
||||||
been re-factored and no longer includes pcre2_internal.h.
|
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
|
Version 10.21 12-January-2016
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
|
@ -182,7 +182,10 @@ static pthread_mutex_t dev_zero_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||||
static SLJIT_INLINE sljit_s32 open_dev_zero(void)
|
static SLJIT_INLINE sljit_s32 open_dev_zero(void)
|
||||||
{
|
{
|
||||||
pthread_mutex_lock(&dev_zero_mutex);
|
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);
|
pthread_mutex_unlock(&dev_zero_mutex);
|
||||||
return dev_zero < 0;
|
return dev_zero < 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue