Commit 2398fe90 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

MoficationsNotifier: Add a flush method

parent e742dc44
......@@ -115,6 +115,15 @@ void ModificationNotifier::notifyPlaylistRemoval( int64_t playlistId )
notifyRemoval( playlistId, m_playlists );
}
void ModificationNotifier::flush()
{
{
std::unique_lock<compat::Mutex> lock( m_lock );
m_timeout = std::chrono::steady_clock::now();
}
m_cond.notify_all();
}
void ModificationNotifier::run()
{
#if !defined(_LIBCPP_STD_VER) || (_LIBCPP_STD_VER > 11 && !defined(_LIBCPP_HAS_NO_CXX14_CONSTEXPR))
......
......@@ -59,6 +59,14 @@ public:
void notifyPlaylistModification( PlaylistPtr playlist );
void notifyPlaylistRemoval( int64_t playlistId );
/**
* @brief flush Flushes the notifications queues
*
* This will cause all modifications to be sent to the listeners, regardless
* of timeouts.
*/
void flush();
private:
void run();
void notify();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment