Skip to content

Commit

Permalink
MtQ: clarification
Browse files Browse the repository at this point in the history
  • Loading branch information
fchn289 committed Oct 18, 2023
1 parent 35fb063 commit e11b0af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/thread/MtInQueue.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ using namespace std;

namespace RLib
{
using ElePair = pair<shared_ptr<void>, size_t>; // ele & its typeid.hash_code
// ele & its typeid.hash_code
// - hash_code is size_t (simplest) vs type_info (complex class, & need more mem)
using ElePair = pair<shared_ptr<void>, size_t>;

// ***********************************************************************************************
class MtInQueue
Expand Down
2 changes: 1 addition & 1 deletion ut/thread/MT_SemphoreTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ TEST_F(MT_SemaphoreTest, GOLD_integrate_MsgSelf_ThreadBack_MtInQueue) // simula
for (;;)
{
auto elePair = mtQ_.pop();
if (elePair.first == nullptr) break;
if (elePair.first == nullptr) break; // handle next eg MsgSelf queue
msgHdlrs[elePair.second](elePair.first);
}

Expand Down

0 comments on commit e11b0af

Please sign in to comment.