Revision: 1647
http://vcs.pcre.org/viewvc?view=rev&revision=1647
Author: zherczeg
Date: 2016-05-19 19:02:51 +0100 (Thu, 19 May 2016)
Log Message:
-----------
A racing condition is fixed in JIT reported by Mozilla.
Modified Paths:
--------------
code/trunk/ChangeLog
code/trunk/sljit/sljitUtils.c
Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog 2016-04-12 11:17:23 UTC (rev 1646)
+++ code/trunk/ChangeLog 2016-05-19 18:02:51 UTC (rev 1647)
@@ -79,7 +79,9 @@
that certain errors, provoked by the SSE2 instruction set when JIT is used,
are ignored.
+20. A racing condition is fixed in JIT reported by Mozilla.
+
Version 8.38 23-November-2015
-----------------------------
Modified: code/trunk/sljit/sljitUtils.c
===================================================================
--- code/trunk/sljit/sljitUtils.c 2016-04-12 11:17:23 UTC (rev 1646)
+++ code/trunk/sljit/sljitUtils.c 2016-05-19 18:02:51 UTC (rev 1647)
@@ -182,7 +182,10 @@
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;
}