Browse Source

Don't use recursive mutex for nicknames anymore

7.0
Jon Evans 3 years ago
parent
commit
26ba8e1938
  1. 4
      common/lib_table_base.cpp
  2. 6
      include/lib_table_base.h

4
common/lib_table_base.cpp

@ -298,10 +298,10 @@ std::vector<wxString> LIB_TABLE::GetLogicalLibs()
bool LIB_TABLE::InsertRow( LIB_TABLE_ROW* aRow, bool doReplace )
{
std::lock_guard<std::recursive_mutex> lock( m_nickIndexMutex );
ensureIndex();
std::lock_guard<std::mutex> lock( m_nickIndexMutex );
INDEX_CITER it = nickIndex.find( aRow->GetNickName() );
aRow->SetParent( this );

6
include/lib_table_base.h

@ -340,7 +340,7 @@ public:
/// Delete all rows.
void Clear()
{
std::lock_guard<std::recursive_mutex> lock( m_nickIndexMutex );
std::lock_guard<std::mutex> lock( m_nickIndexMutex );
rows.clear();
nickIndex.clear();
@ -525,7 +525,7 @@ protected:
void reindex()
{
std::lock_guard<std::recursive_mutex> lock( m_nickIndexMutex );
std::lock_guard<std::mutex> lock( m_nickIndexMutex );
nickIndex.clear();
@ -561,7 +561,7 @@ protected:
LIB_TABLE* fallBack;
/// Mutex to protect access to the nickIndex variable
mutable std::recursive_mutex m_nickIndexMutex;
mutable std::mutex m_nickIndexMutex;
};
#endif // _LIB_TABLE_BASE_H_
Loading…
Cancel
Save