From 807c6931fe683fd844ceec1b023232181e6aae03 Mon Sep 17 00:00:00 2001 From: marha Date: Tue, 28 Dec 2010 16:10:20 +0000 Subject: xserver and mesa git update 28-12-2010 --- mesalib/scons/fixes.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 mesalib/scons/fixes.py (limited to 'mesalib/scons/fixes.py') diff --git a/mesalib/scons/fixes.py b/mesalib/scons/fixes.py new file mode 100644 index 000000000..5946106ab --- /dev/null +++ b/mesalib/scons/fixes.py @@ -0,0 +1,27 @@ +import sys + +# Monkey patch os.spawnve on windows to become thread safe +if sys.platform == 'win32': + import os + import threading + 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 + + -- cgit v1.2.3