/*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
}
+void AsyncSignalHandler::attachEventBase(EventBase* eventBase) {
+ assert(eventBase_ == nullptr);
+ assert(signalEvents_.empty());
+ eventBase_ = eventBase;
+}
+
+void AsyncSignalHandler::detachEventBase() {
+ assert(eventBase_ != nullptr);
+ assert(signalEvents_.empty());
+ eventBase_ = nullptr;
+}
+
void AsyncSignalHandler::registerSignalHandler(int signum) {
pair<SignalEventMap::iterator, bool> ret =
signalEvents_.insert(make_pair(signum, event()));
handler->signalReceived(int(signum));
}
-} // folly
+} // namespace folly