[Mesa-dev] [PATCHv3 09/16] glsl: integrate with the singleton thread pool

Chia-I Wu olvaffe at gmail.com
Tue Aug 19 23:40:30 PDT 2014


The singleton thread pool will be used by contexts to queue compilation tasks.
We need to control its lieftime from the compiler.

Signed-off-by: Chia-I Wu <olv at lunarg.com>
---
 src/glsl/glsl_parser_extras.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index b17cdb1..9342908 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -32,6 +32,7 @@ extern "C" {
 }
 
 #include "util/ralloc.h"
+#include "util/threadpool.h"
 #include "ast.h"
 #include "glsl_parser_extras.h"
 #include "glsl_parser.h"
@@ -1626,6 +1627,8 @@ extern "C" {
 void
 _mesa_destroy_shader_compiler(void)
 {
+   _mesa_threadpool_destroy_singleton();
+
    _mesa_destroy_shader_compiler_caches();
 
    _mesa_glsl_release_types();
@@ -1639,6 +1642,7 @@ _mesa_destroy_shader_compiler(void)
 void
 _mesa_destroy_shader_compiler_caches(void)
 {
+   _mesa_threadpool_wait_singleton();
    _mesa_glsl_release_builtin_functions();
 }
 
-- 
2.0.0.rc2



More information about the mesa-dev mailing list