https://clickhouse-test-reports.s3.yandex.net/18817/9049599e367bcccd809f45af138452f965b3303a/stress_test_(undefined)/test_run.txt.out.log
{
public:
    static TemporaryLiveViewCleaner & instance() { return *the_instance; }
    
    void addView(const std::shared_ptr<StorageLiveView> & view);
    
    static void init(Context & global_context_);
    static void shutdown();
private:
    friend std::unique_ptr<TemporaryLiveViewCleaner>::deleter_type;
    TemporaryLiveViewCleaner(Context & global_context_);
    ~TemporaryLiveViewCleaner();
    void backgroundThreadFunc();
    void stopBackgroundThread();
    struct StorageAndTimeOfCheck
    {
        std::weak_ptr<StorageLiveView> storage;
        std::chrono::system_clock::time_point time_of_check;
        bool operator <(const StorageAndTimeOfCheck & other) const { return time_of_check < other.time_of_check; }
    };
    static std::unique_ptr<TemporaryLiveViewCleaner> the_instance;
    Context & global_context;
    std::mutex mutex;
    std::vector<StorageAndTimeOfCheck> views;
    ThreadFromGlobalPool background_thread;
    std::atomic<bool> background_thread_should_exit = false;
    std::condition_variable background_thread_wake_up;
};
}