diff options
| author | Tomohiro Matsuyama | 2012-09-28 18:34:20 +0900 |
|---|---|---|
| committer | Tomohiro Matsuyama | 2012-09-28 18:34:20 +0900 |
| commit | 704d3f455f837fd8881c72f82788a282ff093c82 (patch) | |
| tree | 511fc4995a70e6959089b197a1238bfa1812804e /src | |
| parent | 96fb71705b3d2aa1eaf2ecd0e447d23995b74b6e (diff) | |
| download | emacs-704d3f455f837fd8881c72f82788a282ff093c82.tar.gz emacs-704d3f455f837fd8881c72f82788a282ff093c82.zip | |
* profiler.c (sigprof_handler): Fix race condition.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/profiler.c | 9 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 601c72a9fd3..d6a6d91b75a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2012-09-28 Tomohiro Matsuyama <tomo@cx4a.org> | ||
| 2 | |||
| 3 | * profiler.c (sigprof_handler): Fix race condition. | ||
| 4 | |||
| 1 | 2012-09-28 Glenn Morris <rgm@gnu.org> | 5 | 2012-09-28 Glenn Morris <rgm@gnu.org> |
| 2 | 6 | ||
| 3 | * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528) | 7 | * 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 <http://www.gnu.org/licenses/>. */ | |||
| 24 | #include <signal.h> | 24 | #include <signal.h> |
| 25 | #include <setjmp.h> | 25 | #include <setjmp.h> |
| 26 | #include "lisp.h" | 26 | #include "lisp.h" |
| 27 | #include "syssignal.h" | ||
| 27 | 28 | ||
| 28 | /* Logs. */ | 29 | /* Logs. */ |
| 29 | 30 | ||
| @@ -214,7 +215,7 @@ static int current_sample_interval; | |||
| 214 | /* Signal handler for sample profiler. */ | 215 | /* Signal handler for sample profiler. */ |
| 215 | 216 | ||
| 216 | static void | 217 | static void |
| 217 | sigprof_handler (int signal) | 218 | sigprof_handler_1 (int signal) |
| 218 | { | 219 | { |
| 219 | eassert (HASH_TABLE_P (cpu_log)); | 220 | eassert (HASH_TABLE_P (cpu_log)); |
| 220 | if (backtrace_list && EQ (*backtrace_list->function, Qautomatic_gc)) | 221 | if (backtrace_list && EQ (*backtrace_list->function, Qautomatic_gc)) |
| @@ -229,6 +230,12 @@ sigprof_handler (int signal) | |||
| 229 | record_backtrace (XHASH_TABLE (cpu_log), current_sample_interval); | 230 | record_backtrace (XHASH_TABLE (cpu_log), current_sample_interval); |
| 230 | } | 231 | } |
| 231 | 232 | ||
| 233 | static void | ||
| 234 | sigprof_handler (int signal) | ||
| 235 | { | ||
| 236 | deliver_process_signal (signal, sigprof_handler_1); | ||
| 237 | } | ||
| 238 | |||
| 232 | DEFUN ("profiler-cpu-start", Fprofiler_cpu_start, Sprofiler_cpu_start, | 239 | DEFUN ("profiler-cpu-start", Fprofiler_cpu_start, Sprofiler_cpu_start, |
| 233 | 1, 1, 0, | 240 | 1, 1, 0, |
| 234 | doc: /* Start or restart the cpu profiler. | 241 | doc: /* Start or restart the cpu profiler. |