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

Side by Side Diff: base/process/kill_posix.cc

Issue 862133002: Update from https://crrev.com/312398 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/process/kill.h" 5 #include "base/process/kill.h"
6 6
7 #include <signal.h> 7 #include <signal.h>
8 #include <sys/types.h> 8 #include <sys/types.h>
9 #include <sys/wait.h> 9 #include <sys/wait.h>
10 #include <unistd.h> 10 #include <unistd.h>
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 void EnsureProcessTerminated(Process process) { 466 void EnsureProcessTerminated(Process process) {
467 // If the child is already dead, then there's nothing to do. 467 // If the child is already dead, then there's nothing to do.
468 if (IsChildDead(process.pid())) 468 if (IsChildDead(process.pid()))
469 return; 469 return;
470 470
471 const unsigned timeout = 2; // seconds 471 const unsigned timeout = 2; // seconds
472 BackgroundReaper* reaper = new BackgroundReaper(process.pid(), timeout); 472 BackgroundReaper* reaper = new BackgroundReaper(process.pid(), timeout);
473 PlatformThread::CreateNonJoinable(0, reaper); 473 PlatformThread::CreateNonJoinable(0, reaper);
474 } 474 }
475 475
476 void EnsureProcessGetsReaped(ProcessHandle process) { 476 void EnsureProcessGetsReaped(ProcessId pid) {
477 // If the child is already dead, then there's nothing to do. 477 // If the child is already dead, then there's nothing to do.
478 if (IsChildDead(process)) 478 if (IsChildDead(pid))
479 return; 479 return;
480 480
481 BackgroundReaper* reaper = new BackgroundReaper(process, 0); 481 BackgroundReaper* reaper = new BackgroundReaper(pid, 0);
482 PlatformThread::CreateNonJoinable(0, reaper); 482 PlatformThread::CreateNonJoinable(0, reaper);
483 } 483 }
484 484
485 #endif // !defined(OS_MACOSX) 485 #endif // !defined(OS_MACOSX)
486 #endif // !defined(OS_NACL_NONSFI) 486 #endif // !defined(OS_NACL_NONSFI)
487 487
488 } // namespace base 488 } // namespace base
OLDNEW
« no previous file with comments | « base/process/kill.h ('k') | base/process/launch.h » ('j') | shell/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698