Skip to content

Commit 898d751

Browse files
committed
Update comments on Windows job objects
1 parent a89f340 commit 898d751

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/bootstrap/bootstrap.py

+2
Original file line numberDiff line numberDiff line change
@@ -1184,6 +1184,8 @@ def bootstrap(args):
11841184
args = [build.bootstrap_binary()]
11851185
args.extend(sys.argv[1:])
11861186
env = os.environ.copy()
1187+
# The Python process ID is used when creating a Windows job object
1188+
# (see src\bootstrap\src\utils\job.rs)
11871189
env["BOOTSTRAP_PARENT_ID"] = str(os.getpid())
11881190
env["BOOTSTRAP_PYTHON"] = sys.executable
11891191
run(args, env=env, verbose=build.verbose, is_bootstrap=True)

src/bootstrap/src/utils/job.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ pub unsafe fn setup(build: &mut crate::Build) {
1515
///
1616
/// Most of the time when you're running a build system (e.g., make) you expect
1717
/// Ctrl-C or abnormal termination to actually terminate the entire tree of
18-
/// process in play, not just the one at the top. This currently works "by
18+
/// processes in play. This currently works "by
1919
/// default" on Unix platforms because Ctrl-C actually sends a signal to the
20-
/// *process group* rather than the parent process, so everything will get torn
21-
/// down. On Windows, however, this does not happen and Ctrl-C just kills the
22-
/// parent process.
20+
/// *process group* so everything will get torn
21+
/// down. On Windows, however, Ctrl-C is only sent to processes in the same console.
22+
/// If a process is detached or attached to another console, it won't receive the
23+
/// signal.
2324
///
2425
/// To achieve the same semantics on Windows we use Job Objects to ensure that
2526
/// all processes die at the same time. Job objects have a mode of operation

0 commit comments

Comments
 (0)