OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "platform/globals.h" | 5 #include "platform/globals.h" |
6 #if defined(TARGET_OS_ANDROID) | 6 #if defined(TARGET_OS_ANDROID) |
7 | 7 |
8 #include <sys/syscall.h> // NOLINT | 8 #include <sys/syscall.h> // NOLINT |
9 #include <errno.h> // NOLINT | 9 #include <errno.h> // NOLINT |
10 | 10 |
11 #include "vm/flags.h" | 11 #include "vm/flags.h" |
12 #include "vm/os.h" | 12 #include "vm/os.h" |
13 #include "vm/profiler.h" | 13 #include "vm/profiler.h" |
14 #include "vm/signal_handler.h" | 14 #include "vm/signal_handler.h" |
15 #include "vm/thread_interrupter.h" | 15 #include "vm/thread_interrupter.h" |
16 | 16 |
17 namespace dart { | 17 namespace dart { |
18 | 18 |
| 19 #ifndef PRODUCT |
| 20 |
19 DECLARE_FLAG(bool, thread_interrupter); | 21 DECLARE_FLAG(bool, thread_interrupter); |
20 DECLARE_FLAG(bool, trace_thread_interrupter); | 22 DECLARE_FLAG(bool, trace_thread_interrupter); |
21 | 23 |
22 class ThreadInterrupterAndroid : public AllStatic { | 24 class ThreadInterrupterAndroid : public AllStatic { |
23 public: | 25 public: |
24 static void ThreadInterruptSignalHandler(int signal, siginfo_t* info, | 26 static void ThreadInterruptSignalHandler(int signal, siginfo_t* info, |
25 void* context_) { | 27 void* context_) { |
26 if (signal != SIGPROF) { | 28 if (signal != SIGPROF) { |
27 return; | 29 return; |
28 } | 30 } |
(...skipping 28 matching lines...) Expand all Loading... |
57 void ThreadInterrupter::InstallSignalHandler() { | 59 void ThreadInterrupter::InstallSignalHandler() { |
58 SignalHandler::Install( | 60 SignalHandler::Install( |
59 ThreadInterrupterAndroid::ThreadInterruptSignalHandler); | 61 ThreadInterrupterAndroid::ThreadInterruptSignalHandler); |
60 } | 62 } |
61 | 63 |
62 | 64 |
63 void ThreadInterrupter::RemoveSignalHandler() { | 65 void ThreadInterrupter::RemoveSignalHandler() { |
64 SignalHandler::Remove(); | 66 SignalHandler::Remove(); |
65 } | 67 } |
66 | 68 |
| 69 #endif // !PRODUCT |
| 70 |
67 } // namespace dart | 71 } // namespace dart |
68 | 72 |
69 #endif // defined(TARGET_OS_ANDROID) | 73 #endif // defined(TARGET_OS_ANDROID) |
OLD | NEW |