mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-26 10:11:30 +00:00
Move the Library
mutex in Library::Impl
.
The why of this mutex is in `Library` is a bit complex. It has been introduced inc2927ce
when there was only `Library` and no `std::unique_ptr<Impl>`. As introducing the mutex imply implementing the move constructor, we have split all data in `LibraryBase` (and keep a default move constructor here) and add the mutex in `Library` (and implement a simple move constructor). Later, in090c2fd
, we have move the `LibraryBase` to `Library::Impl` (which should have been `Library::Data`). So at the end, `Library::Impl` is never moved. We can move the `mutex` in it and still simply implement move constructor for `Library`.
This commit is contained in:
@ -178,9 +178,6 @@ class ZimSearcher : public zim::Searcher
|
||||
*/
|
||||
class Library: public std::enable_shared_from_this<Library>
|
||||
{
|
||||
// all data fields must be added in LibraryBase
|
||||
mutable std::mutex m_mutex;
|
||||
|
||||
public:
|
||||
typedef uint64_t Revision;
|
||||
typedef std::vector<std::string> BookIdCollection;
|
||||
|
Reference in New Issue
Block a user