Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(377)

Side by Side Diff: runtime/bin/process_linux.cc

Issue 149253013: Document ProcessSignal::watch. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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_LINUX) 6 #if defined(TARGET_OS_LINUX)
7 7
8 #include "bin/process.h" 8 #include "bin/process.h"
9 9
10 #include <errno.h> // NOLINT 10 #include <errno.h> // NOLINT
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 } 627 }
628 628
629 629
630 intptr_t Process::CurrentProcessId() { 630 intptr_t Process::CurrentProcessId() {
631 return static_cast<intptr_t>(getpid()); 631 return static_cast<intptr_t>(getpid());
632 } 632 }
633 633
634 634
635 static Mutex* signal_mutex = new Mutex(); 635 static Mutex* signal_mutex = new Mutex();
636 static SignalInfo* signal_handlers = NULL; 636 static SignalInfo* signal_handlers = NULL;
637 static const int kSignalsCount = 5; 637 static const int kSignalsCount = 6;
638 static const int kSignals[kSignalsCount] = { 638 static const int kSignals[kSignalsCount] = {
639 SIGHUP,
639 SIGINT, 640 SIGINT,
640 SIGWINCH,
641 SIGTERM, 641 SIGTERM,
642 SIGUSR1, 642 SIGUSR1,
643 SIGUSR2 643 SIGUSR2,
644 SIGWINCH
644 }; 645 };
645 646
646 647
647 SignalInfo::~SignalInfo() { 648 SignalInfo::~SignalInfo() {
648 VOID_TEMP_FAILURE_RETRY(close(fd_)); 649 VOID_TEMP_FAILURE_RETRY(close(fd_));
649 } 650 }
650 651
651 652
652 static void SignalHandler(int signal) { 653 static void SignalHandler(int signal) {
653 MutexLocker lock(signal_mutex); 654 MutexLocker lock(signal_mutex);
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 bzero(&act, sizeof(act)); 742 bzero(&act, sizeof(act));
742 act.sa_handler = SIG_DFL; 743 act.sa_handler = SIG_DFL;
743 VOID_TEMP_FAILURE_RETRY_BLOCK_SIGNALS(sigaction(signal, &act, NULL)); 744 VOID_TEMP_FAILURE_RETRY_BLOCK_SIGNALS(sigaction(signal, &act, NULL));
744 } 745 }
745 } 746 }
746 747
747 } // namespace bin 748 } // namespace bin
748 } // namespace dart 749 } // namespace dart
749 750
750 #endif // defined(TARGET_OS_LINUX) 751 #endif // defined(TARGET_OS_LINUX)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698