mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-24 06:56:14 +02:00
Fix potential duplicate activity IDs in forked child processes
This commit is contained in:
parent
def7b251d0
commit
034340aa9f
1 changed files with 2 additions and 2 deletions
|
@ -130,11 +130,11 @@ Logger * makeSimpleLogger(bool printBuildLogs)
|
||||||
return new SimpleLogger(printBuildLogs);
|
return new SimpleLogger(printBuildLogs);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::atomic<uint64_t> nextId{(uint64_t) getpid() << 32};
|
std::atomic<uint64_t> nextId{0};
|
||||||
|
|
||||||
Activity::Activity(Logger & logger, Verbosity lvl, ActivityType type,
|
Activity::Activity(Logger & logger, Verbosity lvl, ActivityType type,
|
||||||
const std::string & s, const Logger::Fields & fields, ActivityId parent)
|
const std::string & s, const Logger::Fields & fields, ActivityId parent)
|
||||||
: logger(logger), id(nextId++)
|
: logger(logger), id(nextId++ + (((uint64_t) getpid()) << 32))
|
||||||
{
|
{
|
||||||
logger.startActivity(id, lvl, type, s, fields, parent);
|
logger.startActivity(id, lvl, type, s, fields, parent);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue