mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
mkdir: document why a mutex is necessary
This commit is contained in:
parent
f8a5dbc41c
commit
90ed91608e
1 changed files with 4 additions and 0 deletions
|
@ -6,6 +6,10 @@ use once_cell::sync::Lazy;
|
||||||
use std::os::unix::fs::PermissionsExt;
|
use std::os::unix::fs::PermissionsExt;
|
||||||
use std::sync::Mutex;
|
use std::sync::Mutex;
|
||||||
|
|
||||||
|
// tests in `test_mkdir.rs` cannot run in parallel since some tests alter the umask. This may cause
|
||||||
|
// other tests to run under a wrong set of permissions
|
||||||
|
//
|
||||||
|
// when writing a test case, acquire this mutex before proceeding with the main logic of the test
|
||||||
static TEST_MUTEX: Lazy<Mutex<()>> = Lazy::new(|| Mutex::new(()));
|
static TEST_MUTEX: Lazy<Mutex<()>> = Lazy::new(|| Mutex::new(()));
|
||||||
|
|
||||||
static TEST_DIR1: &str = "mkdir_test1";
|
static TEST_DIR1: &str = "mkdir_test1";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue