Skip to content

Commit

Permalink
ThreadBack: simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
fchn289 committed Dec 8, 2023
1 parent b6bf8ff commit eacf445
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/thread/MtInQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ size_t MtInQueue::handleAllEle()
if (! guard.owns_lock())
{
mt_pingMainTH(); // for possible ele in queue_
this_thread::yield(); // avoid main thread keep checking
this_thread::yield(); // avoid main thread keep checking; no ut for optimization
return nEle;
}
cache_.swap(queue_);
Expand Down
6 changes: 3 additions & 3 deletions src/thread/ThreadBack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include <iostream>
#include <memory>

#include "ThreadBack.hpp"
#include "MT_PingMainTH.hpp"
#include "ThreadBack.hpp"

namespace RLib
{
Expand All @@ -31,8 +31,8 @@ size_t ThreadBack::hdlFinishedThreads(UniLog& oneLog)
}
else
++it;
}
return nHandled; // though mt_nFinishedThread_ may > 0, to avoid dead-loop, & limit-duty
} // 1 loop, simple & safe
return nHandled;
}

// ***********************************************************************************************
Expand Down

0 comments on commit eacf445

Please sign in to comment.