VirtualEventBase(const VirtualEventBase&) = delete;
VirtualEventBase& operator=(const VirtualEventBase&) = delete;
- ~VirtualEventBase();
+ ~VirtualEventBase() override;
EventBase& getEventBase() {
return evb_;
protected:
void keepAliveRelease() override {
- DCHECK(getEventBase().inRunningEventBaseThread());
+ DCHECK(getEventBase().isInEventBaseThread());
if (loopKeepAliveCountAtomic_.load()) {
loopKeepAliveCount_ += loopKeepAliveCountAtomic_.exchange(0);
}
private:
friend class EventBase;
+ ssize_t keepAliveCount() {
+ if (loopKeepAliveCountAtomic_.load()) {
+ loopKeepAliveCount_ += loopKeepAliveCountAtomic_.exchange(0);
+ }
+ return loopKeepAliveCount_;
+ }
+
std::future<void> destroy();
void destroyImpl();