55 lines
1.8 KiB
Diff
55 lines
1.8 KiB
Diff
It seems that avoiding to create local aliases for the self._rlock and
|
|
self._wlock methods prevents the strange errors on i686 related to
|
|
semaphore locking and unlocking.
|
|
|
|
One example of failing builds is firefox-esr running gyp in an i686 environment.
|
|
|
|
--- Lib/multiprocessing/queues.py 2017-09-16 19:38:35.000000000 +0200
|
|
+++ Lib/multiprocessing/queues.py 2017-10-24 19:49:06.291351206 +0200
|
|
@@ -369,13 +369,11 @@
|
|
|
|
def _make_methods(self):
|
|
- recv = self._reader.recv
|
|
- racquire, rrelease = self._rlock.acquire, self._rlock.release
|
|
def get():
|
|
- racquire()
|
|
- try:
|
|
- return recv()
|
|
- finally:
|
|
- rrelease()
|
|
+ self._rlock.acquire()
|
|
+ try:
|
|
+ return self._reader.recv()
|
|
+ finally:
|
|
+ self._rlock.release()
|
|
self.get = get
|
|
|
|
if self._wlock is None:
|
|
@@ -383,11 +382,9 @@
|
|
self.put = self._writer.send
|
|
else:
|
|
- send = self._writer.send
|
|
- wacquire, wrelease = self._wlock.acquire, self._wlock.release
|
|
def put(obj):
|
|
- wacquire()
|
|
- try:
|
|
- return send(obj)
|
|
- finally:
|
|
- wrelease()
|
|
+ self._wlock.acquire()
|
|
+ try:
|
|
+ return self._writer.send(obj)
|
|
+ finally:
|
|
+ self._wlock.release()
|
|
self.put = put
|
|
--- Modules/_multiprocessing/semaphore.c 2017-09-16 19:38:35.000000000 +0200
|
|
+++ Modules/_multiprocessing/semaphore.c 2017-10-28 10:49:56.944993401 +0200
|
|
@@ -378,7 +378,7 @@
|
|
}
|
|
}
|
|
#else
|
|
- int sval;
|
|
+ int sval = -1;
|
|
|
|
/* This check is not an absolute guarantee that the semaphore
|
|
does not rise above maxvalue. */
|