diff options
| author | BaoshanPang <pangbw@gmail.com> | 2019-11-20 14:24:59 -0800 |
|---|---|---|
| committer | BaoshanPang <pangbw@gmail.com> | 2019-11-22 14:36:54 -0800 |
| commit | de362b41468f71ab7b1843007f97d4c1ca93638c (patch) | |
| tree | 8b1d729ff9bc4108df3cb8c11344f7a633bd8e20 /src/libstd/sys/vxworks/process | |
| parent | e20f630f1caf7e95a725ed524109fc168a9e1345 (diff) | |
| download | rust-de362b41468f71ab7b1843007f97d4c1ca93638c.tar.gz rust-de362b41468f71ab7b1843007f97d4c1ca93638c.zip | |
ensure that access to the environment is synchronized
Diffstat (limited to 'src/libstd/sys/vxworks/process')
| -rw-r--r-- | src/libstd/sys/vxworks/process/process_vxworks.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libstd/sys/vxworks/process/process_vxworks.rs b/src/libstd/sys/vxworks/process/process_vxworks.rs index 1ec318e0745..79bfd770f8e 100644 --- a/src/libstd/sys/vxworks/process/process_vxworks.rs +++ b/src/libstd/sys/vxworks/process/process_vxworks.rs @@ -55,13 +55,17 @@ impl Command { let c_envp = envp.as_ref().map(|c| c.as_ptr()) .unwrap_or_else(|| *sys::os::environ() as *const _); - + let stack_size = thread::min_stack(); + + // ensure that access to the environment is synchronized + let _lock = sys::os::env_lock(); + let ret = libc::rtpSpawn( self.get_argv()[0], // executing program self.get_argv().as_ptr() as *mut *const c_char, // argv c_envp as *mut *const c_char, 100 as c_int, // initial priority - thread::min_stack(), // initial stack size. + stack_size, // initial stack size. 0, // options 0 // task options ); |
