diff options
| author | Arseny Smirnov <arseny30@gmail.com> | 2020-08-10 17:10:16 +0300 |
|---|---|---|
| committer | Arseny Smirnov <arseny30@gmail.com> | 2020-08-10 17:10:16 +0300 |
| commit | 4d19016970f615ccf27c7d11043d92e5e67fab57 (patch) | |
| tree | cdfc177ade2ce0af6af58624ca98fd9d679fcac3 /tdnet/td/net/HttpConnectionBase.cpp | |
| parent | 301d0577ba48a44ee19ade8114879203c833c3e9 (diff) | |
HttpConnection: safe migrate between schedulers
GitOrigin-RevId: 2bcc79fc100613a86a8048a2c35e4791903ccb11
Diffstat (limited to 'tdnet/td/net/HttpConnectionBase.cpp')
| -rw-r--r-- | tdnet/td/net/HttpConnectionBase.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tdnet/td/net/HttpConnectionBase.cpp b/tdnet/td/net/HttpConnectionBase.cpp index 3a7e5f261..652def782 100644 --- a/tdnet/td/net/HttpConnectionBase.cpp +++ b/tdnet/td/net/HttpConnectionBase.cpp @@ -190,5 +190,13 @@ void HttpConnectionBase::loop() { } } +void HttpConnectionBase::on_start_migrate(int32 sched_id) { + Scheduler::unsubscribe(fd_.get_poll_info().get_pollable_fd_ref()); +} + +void HttpConnectionBase::on_finish_migrate() { + Scheduler::subscribe(fd_.get_poll_info().extract_pollable_fd(this)); +} + } // namespace detail } // namespace td |
