mirror of
https://github.com/NixOS/nix
synced 2025-06-25 10:41:16 +02:00
Merge pull request #13100 from NaN-git/fix-musl-deadlock
allocate SimpleLogger before forking
This commit is contained in:
commit
5565679b45
1 changed files with 2 additions and 1 deletions
|
@ -202,6 +202,7 @@ static int childEntry(void * arg)
|
||||||
|
|
||||||
pid_t startProcess(std::function<void()> fun, const ProcessOptions & options)
|
pid_t startProcess(std::function<void()> fun, const ProcessOptions & options)
|
||||||
{
|
{
|
||||||
|
auto newLogger = makeSimpleLogger();
|
||||||
ChildWrapperFunction wrapper = [&] {
|
ChildWrapperFunction wrapper = [&] {
|
||||||
if (!options.allowVfork) {
|
if (!options.allowVfork) {
|
||||||
/* Set a simple logger, while releasing (not destroying)
|
/* Set a simple logger, while releasing (not destroying)
|
||||||
|
@ -210,7 +211,7 @@ pid_t startProcess(std::function<void()> fun, const ProcessOptions & options)
|
||||||
~ProgressBar() tries to join a thread that doesn't
|
~ProgressBar() tries to join a thread that doesn't
|
||||||
exist. */
|
exist. */
|
||||||
logger.release();
|
logger.release();
|
||||||
logger = makeSimpleLogger();
|
logger = std::move(newLogger);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue