Skip to content

Commit

Permalink
[core] Removed logging in cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikołaj Małecki authored and maxsharabayko committed Apr 16, 2021
1 parent 97efa1b commit 8608ad2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion srtcore/api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,14 @@ int CUDTUnited::startup()

int CUDTUnited::cleanup()
{
// IMPORTANT!!!
// In this function there must be NO LOGGING AT ALL. This function may
// potentially be called from within the global program destructor, and
// therefore some of the facilities used by the logging system - including
// the default std::cerr object bound to it by default, but also a different
// stream that the user's app has bound to it, and which got destroyed
// together with already exited main() - may be already deleted when
// executing this procedure.
ScopedLock gcinit(m_InitLock);

if (--m_iInstanceCount > 0)
Expand All @@ -303,7 +311,6 @@ int CUDTUnited::cleanup()
return 0;

m_bClosing = true;
HLOGC(inlog.Debug, log << "GarbageCollector: thread EXIT");
// NOTE: we can do relaxed signaling here because
// waiting on m_GCStopCond has a 1-second timeout,
// after which the m_bClosing flag is cheched, which
Expand Down

0 comments on commit 8608ad2

Please sign in to comment.