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

Side by Side Diff: runtime/bin/process_macos.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_MACOS) 6 #if defined(TARGET_OS_MACOS)
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 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 } 669 }
670 670
671 671
672 intptr_t Process::CurrentProcessId() { 672 intptr_t Process::CurrentProcessId() {
673 return static_cast<intptr_t>(getpid()); 673 return static_cast<intptr_t>(getpid());
674 } 674 }
675 675
676 676
677 static Mutex* signal_mutex = new Mutex(); 677 static Mutex* signal_mutex = new Mutex();
678 static SignalInfo* signal_handlers = NULL; 678 static SignalInfo* signal_handlers = NULL;
679 static const int kSignalsCount = 5; 679 static const int kSignalsCount = 6;
680 static const int kSignals[kSignalsCount] = { 680 static const int kSignals[kSignalsCount] = {
681 SIGHUP,
681 SIGINT, 682 SIGINT,
682 SIGWINCH,
683 SIGTERM, 683 SIGTERM,
684 SIGUSR1, 684 SIGUSR1,
685 SIGUSR2 685 SIGUSR2,
686 SIGWINCH
686 }; 687 };
687 688
688 689
689 SignalInfo::~SignalInfo() { 690 SignalInfo::~SignalInfo() {
690 VOID_TEMP_FAILURE_RETRY(close(fd_)); 691 VOID_TEMP_FAILURE_RETRY(close(fd_));
691 } 692 }
692 693
693 694
694 static void SignalHandler(int signal) { 695 static void SignalHandler(int signal) {
695 MutexLocker lock(signal_mutex); 696 MutexLocker lock(signal_mutex);
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
787 bzero(&act, sizeof(act)); 788 bzero(&act, sizeof(act));
788 act.sa_handler = SIG_DFL; 789 act.sa_handler = SIG_DFL;
789 VOID_TEMP_FAILURE_RETRY_BLOCK_SIGNALS(sigaction(signal, &act, NULL)); 790 VOID_TEMP_FAILURE_RETRY_BLOCK_SIGNALS(sigaction(signal, &act, NULL));
790 } 791 }
791 } 792 }
792 793
793 } // namespace bin 794 } // namespace bin
794 } // namespace dart 795 } // namespace dart
795 796
796 #endif // defined(TARGET_OS_MACOS) 797 #endif // defined(TARGET_OS_MACOS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698