Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Unified Diff: engine/SCons/Platform/win32.py

Issue 6880195: Applying this fix: (Closed) Base URL: http://src.chromium.org/native_client/trunk/src/third_party/scons-2.0.1/
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « README.nacl ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: engine/SCons/Platform/win32.py
===================================================================
--- engine/SCons/Platform/win32.py (revision 4802)
+++ engine/SCons/Platform/win32.py (working copy)
@@ -41,6 +41,33 @@
from SCons.Platform import TempFileMunge
import SCons.Util
+#NACL_CHANGE(bradnelson) - FROM THIS:
+#NACL_CHANGE(bradnelson) - TO THIS:
+import threading
+
+# Monkey patch os.spawnve on Windows to become thread safe
+from os import spawnve as old_spawnve
+
+spawn_lock = threading.Lock()
+
+def new_spawnve(mode, file, args, env):
+ spawn_lock.acquire()
+ try:
+ if mode == os.P_WAIT:
+ ret = old_spawnve(os.P_NOWAIT, file, args, env)
+ else:
+ ret = old_spawnve(mode, file, args, env)
+ finally:
+ spawn_lock.release()
+ if mode == os.P_WAIT:
+ pid, status = os.waitpid(ret, 0)
+ ret = status >> 8
+ return ret
+
+os.spawnve = new_spawnve
+
+#NACL_CHANGE(bradnelson) - END CHANGES.
+
try:
import msvcrt
import win32api
« no previous file with comments | « README.nacl ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698