mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 22:03:31 +01:00
log: explain why it is safe to leave the log mutex initialized
The log mutex is dynamically initialized, guarded by log_mutex_initialized. We don't want to destroy it, because after it is destroyed, we won't see any more logs. If tor is re-initialized, log_mutex_initialized will still be 1. So we won't trigger any undefined behaviour by trying to re-initialize the log mutex. Part of 31736, but committed in this branch to avoid merge conflicts.
This commit is contained in:
parent
2f8a9a2db6
commit
749c2e1761
@ -804,7 +804,10 @@ logs_free_all(void)
|
||||
}
|
||||
|
||||
/* We _could_ destroy the log mutex here, but that would screw up any logs
|
||||
* that happened between here and the end of execution. */
|
||||
* that happened between here and the end of execution.
|
||||
* If tor is re-initialized, log_mutex_initialized will still be 1. So we
|
||||
* won't trigger any undefined behaviour by trying to re-initialize the
|
||||
* log mutex. */
|
||||
}
|
||||
|
||||
/** Remove and free the log entry <b>victim</b> from the linked-list
|
||||
|
Loading…
Reference in New Issue
Block a user