Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/GStreamer/orc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Schleef <ds@schleef.org>2011-10-02 23:04:57 +0400
committerDavid Schleef <ds@schleef.org>2011-10-02 23:04:57 +0400
commit38379033c0f5ebc9f94b95be85aa6e2b713cbc5e (patch)
tree6a294ac96c254d99d8df111c363d1d51988558d3
parent320a88376697f81c3d0a3c4eaf362d1c2ff08997 (diff)
init: Use global mutex, not once mutex
Um, duh. orc_init() can be called when the once mutex is held.
-rw-r--r--orc/orc.c6
-rw-r--r--tools/orcc.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/orc/orc.c b/orc/orc.c
index c359eb2..8a607c4 100644
--- a/orc/orc.c
+++ b/orc/orc.c
@@ -29,10 +29,10 @@ void _orc_compiler_init(void);
void
orc_init (void)
{
- static int inited = FALSE;
+ static volatile int inited = FALSE;
if (!inited) {
- orc_once_mutex_lock ();
+ orc_global_mutex_lock ();
if (!inited) {
ORC_ASSERT(sizeof(OrcExecutor) == sizeof(OrcExecutorAlt));
@@ -61,7 +61,7 @@ orc_init (void)
inited = TRUE;
}
- orc_once_mutex_unlock ();
+ orc_global_mutex_unlock ();
}
}
diff --git a/tools/orcc.c b/tools/orcc.c
index 54ea870..304fd38 100644
--- a/tools/orcc.c
+++ b/tools/orcc.c
@@ -718,7 +718,7 @@ output_code_execute (OrcProgram *p, FILE *output, int is_inline)
}
}
} else {
- fprintf(output, " static int p_inited = 0;\n");
+ fprintf(output, " static volatile int p_inited = 0;\n");
if (use_code) {
fprintf(output, " static OrcCode *c = 0;\n");
} else {