about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorLeSeulArtichaut <leseulartichaut@gmail.com>2020-05-22 18:30:26 +0200
committerLeSeulArtichaut <leseulartichaut@gmail.com>2020-05-22 18:33:12 +0200
commit01630b26ddcf647a6e87a0d6a18055a7c516cdbc (patch)
treebfe8d5860629beab0a9e39a7987b038eaa47b068 /src/libstd/sys
parenta9ca1ec9280ca1e5020edd699917c3367a30a798 (diff)
downloadrust-01630b26ddcf647a6e87a0d6a18055a7c516cdbc.tar.gz
rust-01630b26ddcf647a6e87a0d6a18055a7c516cdbc.zip
Implement `Sync` for `process::Command on unix and vxworks
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/unix/process/process_common.rs6
-rw-r--r--src/libstd/sys/vxworks/process/process_common.rs6
2 files changed, 8 insertions, 4 deletions
diff --git a/src/libstd/sys/unix/process/process_common.rs b/src/libstd/sys/unix/process/process_common.rs
index 859da691ad2..2d7267263de 100644
--- a/src/libstd/sys/unix/process/process_common.rs
+++ b/src/libstd/sys/unix/process/process_common.rs
@@ -86,11 +86,13 @@ pub struct Command {
     stderr: Option<Stdio>,
 }
 
-// Create a new type for argv, so that we can make it `Send`
+// Create a new type for argv, so that we can make it `Send` and `Sync`
 struct Argv(Vec<*const c_char>);
 
-// It is safe to make Argv Send, because it contains pointers to memory owned by `Command.args`
+// It is safe to make `Argv` `Send` and `Sync`, because it contains
+// pointers to memory owned by `Command.args`
 unsafe impl Send for Argv {}
+unsafe impl Sync for Argv {}
 
 // passed back to std::process with the pipes connected to the child, if any
 // were requested
diff --git a/src/libstd/sys/vxworks/process/process_common.rs b/src/libstd/sys/vxworks/process/process_common.rs
index 6d5506bec5f..78b6e9a4db7 100644
--- a/src/libstd/sys/vxworks/process/process_common.rs
+++ b/src/libstd/sys/vxworks/process/process_common.rs
@@ -49,11 +49,13 @@ pub struct Command {
     stderr: Option<Stdio>,
 }
 
-// Create a new type for argv, so that we can make it `Send`
+// Create a new type for `Argv`, so that we can make it `Send` and `Sync`
 struct Argv(Vec<*const c_char>);
 
-// It is safe to make Argv Send, because it contains pointers to memory owned by `Command.args`
+// It is safe to make `Argv` `Send` and `Sync`, because it contains
+// pointers to memory owned by `Command.args`
 unsafe impl Send for Argv {}
+unsafe impl Sync for Argv {}
 
 // passed back to std::process with the pipes connected to the child, if any
 // were requested