Add multiarg version of Scheduler::destroy_on_scheduler.
This commit is contained in:
parent
376476481c
commit
4cf1e02479
@ -3398,43 +3398,16 @@ ContactsManager::ContactsManager(Td *td, ActorShared<> parent) : td_(td), parent
|
|||||||
}
|
}
|
||||||
|
|
||||||
ContactsManager::~ContactsManager() {
|
ContactsManager::~ContactsManager() {
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), users_);
|
Scheduler::instance()->destroy_on_scheduler(
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), users_full_);
|
G()->get_gc_scheduler_id(), users_, users_full_, user_photos_, unknown_users_, pending_user_photos_,
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), user_photos_);
|
user_profile_photo_file_source_ids_, my_photo_file_id_, chats_, chats_full_, unknown_chats_,
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), unknown_users_);
|
chat_full_file_source_ids_, min_channels_, channels_, channels_full_, unknown_channels_,
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), pending_user_photos_);
|
invalidated_channels_full_, channel_full_file_source_ids_, secret_chats_, unknown_secret_chats_,
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), user_profile_photo_file_source_ids_);
|
secret_chats_with_user_, invite_link_infos_, dialog_access_by_invite_link_, loaded_from_database_users_,
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), my_photo_file_id_);
|
unavailable_user_fulls_, loaded_from_database_chats_, unavailable_chat_fulls_, loaded_from_database_channels_,
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), chats_);
|
unavailable_channel_fulls_, loaded_from_database_secret_chats_, dialog_administrators_,
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), chats_full_);
|
cached_channel_participants_, resolved_phone_numbers_, channel_participants_, all_imported_contacts_,
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), unknown_chats_);
|
linked_channel_ids_, restricted_user_ids_, restricted_channel_ids_);
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), chat_full_file_source_ids_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), min_channels_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), channels_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), channels_full_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), unknown_channels_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), invalidated_channels_full_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), channel_full_file_source_ids_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), secret_chats_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), unknown_secret_chats_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), secret_chats_with_user_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), invite_link_infos_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), dialog_access_by_invite_link_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), loaded_from_database_users_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), unavailable_user_fulls_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), loaded_from_database_chats_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), unavailable_chat_fulls_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), loaded_from_database_channels_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), unavailable_channel_fulls_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), loaded_from_database_secret_chats_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), dialog_administrators_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), cached_channel_participants_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), resolved_phone_numbers_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), channel_participants_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), all_imported_contacts_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), linked_channel_ids_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), restricted_user_ids_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), restricted_channel_ids_);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ContactsManager::tear_down() {
|
void ContactsManager::tear_down() {
|
||||||
|
@ -5809,34 +5809,16 @@ MessagesManager::MessagesManager(Td *td, ActorShared<> parent)
|
|||||||
}
|
}
|
||||||
|
|
||||||
MessagesManager::~MessagesManager() {
|
MessagesManager::~MessagesManager() {
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), ttl_nodes_);
|
Scheduler::instance()->destroy_on_scheduler(
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), ttl_heap_);
|
G()->get_gc_scheduler_id(), ttl_nodes_, ttl_heap_, being_sent_messages_, update_message_ids_,
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), being_sent_messages_);
|
update_scheduled_message_ids_, message_id_to_dialog_id_, last_clear_history_message_id_to_dialog_id_, dialogs_,
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), update_message_ids_);
|
postponed_chat_read_inbox_updates_, found_public_dialogs_, found_on_server_dialogs_, found_common_dialogs_,
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), update_scheduled_message_ids_);
|
message_embedding_codes_[0], message_embedding_codes_[1], replied_by_media_timestamp_messages_,
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), message_id_to_dialog_id_);
|
notification_group_id_to_dialog_id_, active_get_channel_differencies_, get_channel_difference_to_log_event_id_,
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), last_clear_history_message_id_to_dialog_id_);
|
channel_get_difference_retry_timeouts_, is_channel_difference_finished_, resolved_usernames_,
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), dialogs_);
|
inaccessible_resolved_usernames_, dialog_bot_command_message_ids_, full_message_id_to_file_source_id_,
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), postponed_chat_read_inbox_updates_);
|
last_outgoing_forwarded_message_date_, dialog_viewed_messages_, dialog_online_member_counts_,
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), found_public_dialogs_);
|
previous_repaired_read_inbox_max_message_id_);
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), found_on_server_dialogs_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), found_common_dialogs_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), message_embedding_codes_[0]);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), message_embedding_codes_[1]);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), replied_by_media_timestamp_messages_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), notification_group_id_to_dialog_id_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), active_get_channel_differencies_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), get_channel_difference_to_log_event_id_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), channel_get_difference_retry_timeouts_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), is_channel_difference_finished_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), resolved_usernames_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), inaccessible_resolved_usernames_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), dialog_bot_command_message_ids_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), full_message_id_to_file_source_id_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), last_outgoing_forwarded_message_date_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), dialog_viewed_messages_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), dialog_online_member_counts_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), previous_repaired_read_inbox_max_message_id_);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MessagesManager::on_channel_get_difference_timeout_callback(void *messages_manager_ptr, int64 dialog_id_int) {
|
void MessagesManager::on_channel_get_difference_timeout_callback(void *messages_manager_ptr, int64 dialog_id_int) {
|
||||||
|
@ -266,11 +266,8 @@ void PollManager::tear_down() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
PollManager::~PollManager() {
|
PollManager::~PollManager() {
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), polls_);
|
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), polls_, server_poll_messages_,
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), server_poll_messages_);
|
other_poll_messages_, poll_voters_, loaded_from_database_polls_);
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), other_poll_messages_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), poll_voters_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), loaded_from_database_polls_);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PollManager::on_update_poll_timeout_callback(void *poll_manager_ptr, int64 poll_id_int) {
|
void PollManager::on_update_poll_timeout_callback(void *poll_manager_ptr, int64 poll_id_int) {
|
||||||
|
@ -1305,18 +1305,10 @@ StickersManager::StickersManager(Td *td, ActorShared<> parent) : td_(td), parent
|
|||||||
}
|
}
|
||||||
|
|
||||||
StickersManager::~StickersManager() {
|
StickersManager::~StickersManager() {
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), stickers_);
|
Scheduler::instance()->destroy_on_scheduler(
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), sticker_sets_);
|
G()->get_gc_scheduler_id(), stickers_, sticker_sets_, short_name_to_sticker_set_id_, attached_sticker_sets_,
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), short_name_to_sticker_set_id_);
|
found_stickers_, found_sticker_sets_, emoji_language_codes_, emoji_language_code_versions_,
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), attached_sticker_sets_);
|
emoji_language_code_last_difference_times_, reloaded_emoji_keywords_, dice_messages_, emoji_messages_);
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), found_stickers_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), found_sticker_sets_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), emoji_language_codes_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), emoji_language_code_versions_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), emoji_language_code_last_difference_times_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), reloaded_emoji_keywords_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), dice_messages_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), emoji_messages_);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void StickersManager::start_up() {
|
void StickersManager::start_up() {
|
||||||
|
@ -101,9 +101,8 @@ VoiceNotesManager::VoiceNotesManager(Td *td, ActorShared<> parent) : td_(td), pa
|
|||||||
}
|
}
|
||||||
|
|
||||||
VoiceNotesManager::~VoiceNotesManager() {
|
VoiceNotesManager::~VoiceNotesManager() {
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), voice_notes_);
|
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), voice_notes_, voice_note_messages_,
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), voice_note_messages_);
|
message_voice_notes_);
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), message_voice_notes_);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void VoiceNotesManager::tear_down() {
|
void VoiceNotesManager::tear_down() {
|
||||||
|
@ -418,11 +418,8 @@ void WebPagesManager::tear_down() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
WebPagesManager::~WebPagesManager() {
|
WebPagesManager::~WebPagesManager() {
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), web_pages_);
|
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), web_pages_, web_page_messages_,
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), web_page_messages_);
|
got_web_page_previews_, url_to_web_page_id_, url_to_file_source_id_);
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), got_web_page_previews_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), url_to_web_page_id_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), url_to_file_source_id_);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WebPageId WebPagesManager::on_get_web_page(tl_object_ptr<telegram_api::WebPage> &&web_page_ptr,
|
WebPageId WebPagesManager::on_get_web_page(tl_object_ptr<telegram_api::WebPage> &&web_page_ptr,
|
||||||
|
@ -840,14 +840,9 @@ void FileManager::init_actor() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
FileManager::~FileManager() {
|
FileManager::~FileManager() {
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), remote_location_info_);
|
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), remote_location_info_, file_hash_to_file_id_,
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), file_hash_to_file_id_);
|
local_location_to_file_id_, generate_location_to_file_id_,
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), local_location_to_file_id_);
|
pmc_id_to_file_node_id_, file_id_info_, empty_file_ids_, file_nodes_);
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), generate_location_to_file_id_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), pmc_id_to_file_node_id_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), file_id_info_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), empty_file_ids_);
|
|
||||||
Scheduler::instance()->destroy_on_scheduler(G()->get_gc_scheduler_id(), file_nodes_);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
string FileManager::fix_file_extension(Slice file_name, Slice file_type, Slice file_extension) {
|
string FileManager::fix_file_extension(Slice file_name, Slice file_type, Slice file_extension) {
|
||||||
|
@ -105,6 +105,9 @@ class Scheduler {
|
|||||||
template <class T>
|
template <class T>
|
||||||
void destroy_on_scheduler(int32 sched_id, T &value);
|
void destroy_on_scheduler(int32 sched_id, T &value);
|
||||||
|
|
||||||
|
template <class... ArgsT>
|
||||||
|
void destroy_on_scheduler(int32 sched_id, ArgsT &...values);
|
||||||
|
|
||||||
template <ActorSendType send_type, class EventT>
|
template <ActorSendType send_type, class EventT>
|
||||||
void send_lambda(ActorRef actor_ref, EventT &&lambda);
|
void send_lambda(ActorRef actor_ref, EventT &&lambda);
|
||||||
|
|
||||||
|
@ -179,6 +179,13 @@ inline void Scheduler::destroy_on_scheduler(int32 sched_id, T &value) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <class... ArgsT>
|
||||||
|
inline void Scheduler::destroy_on_scheduler(int32 sched_id, ArgsT &...values) {
|
||||||
|
destroy_on_scheduler_impl(sched_id, PromiseCreator::lambda([values = std::make_tuple(std::move(values)...)](Unit) {
|
||||||
|
// destroy values
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
inline void Scheduler::before_tail_send(const ActorId<> &actor_id) {
|
inline void Scheduler::before_tail_send(const ActorId<> &actor_id) {
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user