Only runs in event loop. No locks required. See 'Locking' note at top of file.
| 322 | // Only runs in event loop. No locks required. See 'Locking' note at |
| 323 | // top of file. |
| 324 | void LibeventSSLSocketImpl::event_callback( |
| 325 | bufferevent* /*bev*/, |
| 326 | short events, |
| 327 | void* arg) |
| 328 | { |
| 329 | CHECK(__in_event_loop__); |
| 330 | |
| 331 | std::weak_ptr<LibeventSSLSocketImpl>* handle = |
| 332 | reinterpret_cast<std::weak_ptr<LibeventSSLSocketImpl>*>(CHECK_NOTNULL(arg)); |
| 333 | |
| 334 | std::shared_ptr<LibeventSSLSocketImpl> impl(handle->lock()); |
| 335 | |
| 336 | // Don't call the 'event_callback' unless the socket is still valid. |
| 337 | if (impl != nullptr) { |
| 338 | impl->event_callback(events); |
| 339 | } |
| 340 | } |
| 341 | |
| 342 | |
| 343 | // Only runs in event loop. Member function continuation of static |