add mutex locking when making a copy of the RadioId table to prevent thread-based race conditions;

pull/114/head
Bryan Biedenkapp 4 weeks ago
parent 2654a19544
commit 15be34a338

@ -175,6 +175,17 @@ namespace lookups
* @param id Unique ID to erase. * @param id Unique ID to erase.
*/ */
void eraseEntry(uint32_t id); void eraseEntry(uint32_t id);
/**
* @brief Helper to return the lookup table.
* @returns std::unordered_map<uint32_t, RadioId> Table.
*/
std::unordered_map<uint32_t, RadioId> table() override
{
std::lock_guard<std::mutex> lock(s_mutex);
return m_table;
}
/** /**
* @brief Finds a table entry in this lookup table. * @brief Finds a table entry in this lookup table.
* @param id Unique identifier for table entry. * @param id Unique identifier for table entry.

Loading…
Cancel
Save

Powered by TurnKey Linux.