From: Tomohiro Matsuyama Date: Fri, 28 Sep 2012 09:34:20 +0000 (+0900) Subject: * profiler.c (sigprof_handler): Fix race condition. X-Git-Tag: emacs-24.2.90~244^2~49 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=704d3f455f837fd8881c72f82788a282ff093c82;p=emacs.git * profiler.c (sigprof_handler): Fix race condition. --- diff --git a/src/ChangeLog b/src/ChangeLog index 601c72a9fd3..d6a6d91b75a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2012-09-28 Tomohiro Matsuyama + + * profiler.c (sigprof_handler): Fix race condition. + 2012-09-28 Glenn Morris * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528) diff --git a/src/profiler.c b/src/profiler.c index 877a42cc98e..4d748b547f5 100644 --- a/src/profiler.c +++ b/src/profiler.c @@ -24,6 +24,7 @@ along with GNU Emacs. If not, see . */ #include #include #include "lisp.h" +#include "syssignal.h" /* Logs. */ @@ -214,7 +215,7 @@ static int current_sample_interval; /* Signal handler for sample profiler. */ static void -sigprof_handler (int signal) +sigprof_handler_1 (int signal) { eassert (HASH_TABLE_P (cpu_log)); if (backtrace_list && EQ (*backtrace_list->function, Qautomatic_gc)) @@ -229,6 +230,12 @@ sigprof_handler (int signal) record_backtrace (XHASH_TABLE (cpu_log), current_sample_interval); } +static void +sigprof_handler (int signal) +{ + deliver_process_signal (signal, sigprof_handler_1); +} + DEFUN ("profiler-cpu-start", Fprofiler_cpu_start, Sprofiler_cpu_start, 1, 1, 0, doc: /* Start or restart the cpu profiler.