Move the code generation mutex to Reactor.

Generation of the routines for copying surfaces and blitting
were not protected by the same critical section as the renderer.

Change-Id: I10eb386bdeebb04abc999b3313dc2c3b52adc090
Reviewed-on: https://swiftshader-review.googlesource.com/2772
Tested-by: Greg Hartman <ghartman@google.com>
Reviewed-by: Greg Hartman <ghartman@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
diff --git a/src/Reactor/Nucleus.hpp b/src/Reactor/Nucleus.hpp
index 86e2304..59d43e0 100644
--- a/src/Reactor/Nucleus.hpp
+++ b/src/Reactor/Nucleus.hpp
@@ -13,6 +13,7 @@
 #define sw_Nucleus_hpp

 

 #include "Common/Types.hpp"

+#include "Common/MutexLock.hpp"

 

 #include <stdarg.h>

 #include <vector>

@@ -218,6 +219,8 @@
 		static llvm::LLVMContext *context;

 		static llvm::Module *module;

 		static RoutineManager *routineManager;

+

+		static BackoffLock codegenMutex;

 	};

 

 	class Byte;