1
Fork 0
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:
John Shin 2023-05-24 16:50:08 -07:00
parent f8a5dbc41c
commit 90ed91608e

View file

@ -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";