Only runs in event loop. No locks required. See 'Locking' note at top of file.
| 286 | // Only runs in event loop. No locks required. See 'Locking' note at |
| 287 | // top of file. |
| 288 | void LibeventSSLSocketImpl::send_callback(bufferevent* /*bev*/, void* arg) |
| 289 | { |
| 290 | CHECK(__in_event_loop__); |
| 291 | |
| 292 | std::weak_ptr<LibeventSSLSocketImpl>* handle = |
| 293 | reinterpret_cast<std::weak_ptr<LibeventSSLSocketImpl>*>(CHECK_NOTNULL(arg)); |
| 294 | |
| 295 | std::shared_ptr<LibeventSSLSocketImpl> impl(handle->lock()); |
| 296 | |
| 297 | // Don't call the 'send_callback' unless the socket is still valid. |
| 298 | if (impl != nullptr) { |
| 299 | impl->send_callback(); |
| 300 | } |
| 301 | } |
| 302 | |
| 303 | |
| 304 | // Only runs in event loop. Member function continuation of static |