mirror of
https://github.com/neovim/neovim.git
synced 2025-10-19 16:21:51 +00:00
TUI/thread: guard env map from potential race with unibilium #11259
unibi_from_term calls getenv internally, so exclusive control is required.
This commit is contained in:
@@ -44,6 +44,16 @@ void env_init(void)
|
||||
uv_mutex_init(&mutex);
|
||||
}
|
||||
|
||||
void os_env_var_lock(void)
|
||||
{
|
||||
uv_mutex_lock(&mutex);
|
||||
}
|
||||
|
||||
void os_env_var_unlock(void)
|
||||
{
|
||||
uv_mutex_unlock(&mutex);
|
||||
}
|
||||
|
||||
/// Like getenv(), but returns NULL if the variable is empty.
|
||||
/// @see os_env_exists
|
||||
const char *os_getenv(const char *name)
|
||||
|
Reference in New Issue
Block a user