So, I want to create a async data holder in C++ which can be got only if it has been initialized asynchronously previously. If it has not been initialized, it will return the default value of the type. Is this sufficient?

template<typename T>
class AsyncDataHolder {
    enum class Status { NOT_INITIALIZED, INITIALIZING, INITIALIZED };

    std::function<T()> initializer_;
    Status status_{NOT_INITIALIZED};

    mutable bthread::ConditionVariable cv_;
    mutable bthread::Mutex mtx_;
    T value_;

public:
    AsyncDataHolder(std::function<T()> initializer) : initializer_(initializer) {
    }

    void InitializeAsync() {
        {
            std::unique_lock lock(mtx_);
            status_ = Status::INITIALIZING;
        }

        recall::runDetachedBthread([&]() {
            std::unique_lock lock(mtx_);
            value_ = initializer_();
            status_ = Status::INITIALIZED;
            cv_.notify_all();
        });
    }

    const T& Get() const {
        {
            std::shared_lock lock(mtx_);
            if (status_ == Status::NOT_INITIALIZED) {
                return value_;
            }
        }
        std::unique_lock lock(mtx_);
        while (status_ != Status::INITIALIZED) {
            cv_.wait(lock);
        }
        return value_;
    }
};