Skip to content

Commit

Permalink
Add log mutex locking on Log_stacktrace
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Craggs committed Jul 10, 2014
1 parent 0410d2e commit 31e1f25
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Log.c
Expand Up @@ -439,6 +439,7 @@ void Log_stackTrace(int log_level, int msgno, int thread_id, int current_depth,
if (log_level < trace_settings.trace_level)
return;

Thread_lock_mutex(log_mutex);
cur_entry = Log_pretrace();

memcpy(&(cur_entry->ts), &ts, sizeof(ts));
Expand All @@ -458,6 +459,7 @@ void Log_stackTrace(int log_level, int msgno, int thread_id, int current_depth,
}

Log_posttrace(log_level, cur_entry);
Thread_unlock_mutex(log_mutex);
}


Expand Down

0 comments on commit 31e1f25

Please sign in to comment.