summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--parser.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/parser.c b/parser.c
index b5d3a32..c2ba8d3 100644
--- a/parser.c
+++ b/parser.c
@@ -628,6 +628,9 @@ static gchar* filter_input (gchar *raw_in)
void Parser_main (char *raw_in, int interactive_terminal, void(*cbfunc)(gpointer, gchar *), gpointer user_data)
{
+ static GStaticMutex mutex = G_STATIC_MUTEX_INIT;
+ g_static_mutex_lock (&mutex);
+
int in_pos; /* this identifies the single character of in being processed */
int command_depth; /* how many command words have been parsed */
int old_command_depth; /* save this if in case of a compound message */
@@ -1088,6 +1091,8 @@ void Parser_main (char *raw_in, int interactive_terminal, void(*cbfunc)(gpointer
}
g_free (in);
+
+ g_static_mutex_unlock (&mutex);
}