From fe26b5e0c0a6114247f5bdb619bf09151a75e929 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Fri, 14 Sep 2018 07:39:11 -0700 Subject: [PATCH] modules: thread_local mods::import cannot be used or the module gets stuck. --- ircd/m/event.cc | 10 ++--- ircd/m/m.cc | 86 ++++++++++++++++++++-------------------- ircd/m/room.cc | 2 +- modules/console.cc | 64 +++++++++++++++--------------- modules/m_room.cc | 2 +- modules/m_room_member.cc | 2 +- modules/vm.cc | 4 +- 7 files changed, 85 insertions(+), 85 deletions(-) diff --git a/ircd/m/event.cc b/ircd/m/event.cc index f5096261f..031e2ac9a 100644 --- a/ircd/m/event.cc +++ b/ircd/m/event.cc @@ -24,7 +24,7 @@ ircd::m::pretty(std::ostream &s, const event &e) { using prototype = void (std::ostream &, const event &); - thread_local mods::import pretty + static mods::import pretty { "m_event", "pretty__event" }; @@ -51,7 +51,7 @@ ircd::m::pretty_oneline(std::ostream &s, const bool &content_keys) { using prototype = void (std::ostream &, const event &, const bool &); - thread_local mods::import pretty_oneline + static mods::import pretty_oneline { "m_event", "pretty_oneline__event" }; @@ -76,7 +76,7 @@ ircd::m::pretty_msgline(std::ostream &s, const event &e) { using prototype = void (std::ostream &, const event &); - thread_local mods::import pretty_msgline + static mods::import pretty_msgline { "m_event", "pretty_msgline__event" }; @@ -101,7 +101,7 @@ ircd::m::pretty(std::ostream &s, const event::prev &prev) { using prototype = void (std::ostream &, const event &); - thread_local mods::import pretty + static mods::import pretty { "m_event", "pretty__prev" }; @@ -126,7 +126,7 @@ ircd::m::pretty_oneline(std::ostream &s, const event::prev &prev) { using prototype = void (std::ostream &, const event::prev &); - thread_local mods::import pretty_oneline + static mods::import pretty_oneline { "m_event", "pretty_oneline__prev" }; diff --git a/ircd/m/m.cc b/ircd/m/m.cc index 513ff18a3..c7a4323a2 100644 --- a/ircd/m/m.cc +++ b/ircd/m/m.cc @@ -385,7 +385,7 @@ ircd::m::feds::state::state(const m::room::id &room_id, const milliseconds &, const std::function &); - thread_local mods::import feds__state + static mods::import feds__state { "federation_federation", "feds__state" }; @@ -581,7 +581,7 @@ ircd::m::vm::eval::operator()(const room &room, { using prototype = fault (eval &, const m::room &, json::iov &, const json::iov &); - thread_local mods::import function + static mods::import function { "vm", "eval__commit_room" }; @@ -597,7 +597,7 @@ ircd::m::vm::eval::operator()(json::iov &event, { using prototype = fault (eval &, json::iov &, const json::iov &); - thread_local mods::import function + static mods::import function { "vm", "eval__commit" }; @@ -610,7 +610,7 @@ ircd::m::vm::eval::operator()(const event &event) { using prototype = fault (eval &, const m::event &); - thread_local mods::import function + static mods::import function { "vm", "eval__event" }; @@ -649,7 +649,7 @@ ircd::m::verify(const m::keys &keys) { using prototype = bool (const m::keys &) noexcept; - thread_local mods::import function + static mods::import function { "s_keys", "verify__keys" }; @@ -675,7 +675,7 @@ ircd::m::keys::get(const string_view &server_name, { using prototype = void (const string_view &, const string_view &, const closure &); - thread_local mods::import function + static mods::import function { "s_keys", "get__keys" }; @@ -690,7 +690,7 @@ ircd::m::keys::query(const string_view &query_server, { using prototype = bool (const string_view &, const queries &, const closure_bool &); - thread_local mods::import function + static mods::import function { "s_keys", "query__keys" }; @@ -727,7 +727,7 @@ ircd::m::visible(const event &event, { using prototype = bool (const m::event &, const string_view &); - thread_local mods::import function + static mods::import function { "m_room_history_visibility", "visible" }; @@ -756,7 +756,7 @@ ircd::m::receipt::read(const id::room &room_id, { using prototype = event::id::buf (const id::room &, const id::user &, const id::event &, const time_t &); - thread_local mods::import function + static mods::import function { "client_rooms", "commit__m_receipt_m_read" }; @@ -787,7 +787,7 @@ ircd::m::receipt::read(const id::room &room_id, { using prototype = bool (const id::room &, const id::user &, const id::event::closure &); - thread_local mods::import function + static mods::import function { "m_receipt", "last_receipt__event_id" }; @@ -805,7 +805,7 @@ ircd::m::typing::set(const m::typing &object) { using prototype = event::id::buf (const m::typing &); - thread_local mods::import function + static mods::import function { "client_rooms", "commit__m_typing" }; @@ -845,7 +845,7 @@ ircd::m::presence::set(const presence &object) { using prototype = event::id::buf (const presence &); - thread_local mods::import function + static mods::import function { "m_presence", "commit__m_presence" }; @@ -909,7 +909,7 @@ ircd::m::presence::get(std::nothrow_t, { using prototype = bool (std::nothrow_t, const m::user &, const event_closure &); - thread_local mods::import function + static mods::import function { "m_presence", "get__m_presence" }; @@ -922,7 +922,7 @@ ircd::m::presence::valid_state(const string_view &state) { using prototype = bool (const string_view &); - thread_local mods::import function + static mods::import function { "m_presence", "presence_valid_state" }; @@ -958,7 +958,7 @@ ircd::m::create(const id::node &node_id, { using prototype = node (const id::node &, const json::members &); - thread_local mods::import function + static mods::import function { "s_node", "create_node" }; @@ -972,7 +972,7 @@ ircd::m::exists(const node::id &node_id) { using prototype = bool (const node::id &); - thread_local mods::import function + static mods::import function { "s_node", "exists__nodeid" }; @@ -1509,7 +1509,7 @@ ircd::m::create(const id::user &user_id, { using prototype = user (const id::user &, const json::members &); - thread_local mods::import function + static mods::import function { "client_user", "user_create" }; @@ -1588,7 +1588,7 @@ ircd::m::user::activate() { using prototype = event::id::buf (const m::user &); - thread_local mods::import function + static mods::import function { "client_account", "activate__user" }; @@ -1601,7 +1601,7 @@ ircd::m::user::deactivate() { using prototype = event::id::buf (const m::user &); - thread_local mods::import function + static mods::import function { "client_account", "deactivate__user" }; @@ -1615,7 +1615,7 @@ const { using prototype = bool (const m::user &); - thread_local mods::import function + static mods::import function { "client_account", "is_active__user" }; @@ -1629,7 +1629,7 @@ ircd::m::user::filter(const json::object &filter, { using prototype = event::id::buf (const m::user &, const json::object &, const mutable_buffer &); - thread_local mods::import function + static mods::import function { "client_user", "filter_set" }; @@ -1686,7 +1686,7 @@ const { using prototype = bool (std::nothrow_t, const m::user &, const string_view &, const filter_closure &); - thread_local mods::import function + static mods::import function { "client_user", "filter_get" }; @@ -1702,7 +1702,7 @@ ircd::m::user::account_data(const m::room &room, { using prototype = event::id::buf (const m::user &, const m::room &, const m::user &, const string_view &, const json::object &); - thread_local mods::import function + static mods::import function { "client_user", "room_account_data_set" }; @@ -1717,7 +1717,7 @@ ircd::m::user::account_data(const m::user &sender, { using prototype = event::id::buf (const m::user &, const m::user &, const string_view &, const json::object &); - thread_local mods::import function + static mods::import function { "client_user", "account_data_set" }; @@ -1793,7 +1793,7 @@ const { using prototype = void (const m::user &, const m::room &, const string_view &, const account_data_closure &); - thread_local mods::import function + static mods::import function { "client_user", "room_account_data_get" }; @@ -1808,7 +1808,7 @@ const { using prototype = void (const m::user &, const string_view &, const account_data_closure &); - thread_local mods::import function + static mods::import function { "client_user", "account_data_get" }; @@ -1822,7 +1822,7 @@ ircd::m::user::_account_data_type(const mutable_buffer &out, { using prototype = string_view (const mutable_buffer &, const m::room::id &); - thread_local mods::import function + static mods::import function { "client_user", "room_account_data_type" }; @@ -1837,7 +1837,7 @@ ircd::m::user::profile(const m::user &sender, { using prototype = event::id::buf (const m::user &, const m::user &, const string_view &, const string_view &); - thread_local mods::import function + static mods::import function { "client_profile", "profile_set" }; @@ -1881,7 +1881,7 @@ const { using prototype = void (const m::user &, const string_view &, const profile_closure &); - thread_local mods::import function + static mods::import function { "client_profile", "profile_get" }; @@ -1894,7 +1894,7 @@ ircd::m::user::password(const string_view &password) { using prototype = event::id::buf (const m::user::id &, const string_view &) noexcept; - thread_local mods::import function + static mods::import function { "client_account", "set_password" }; @@ -1908,7 +1908,7 @@ const noexcept try { using prototype = bool (const m::user::id &, const string_view &) noexcept; - thread_local mods::import function + static mods::import function { "client_account", "is_password" }; @@ -2384,7 +2384,7 @@ ircd::m::create(const id::room &room_id, { using prototype = room (const id::room &, const id::user &, const string_view &); - thread_local mods::import function + static mods::import function { "client_createroom", "createroom__type" }; @@ -2400,7 +2400,7 @@ ircd::m::create(const id::room &room_id, { using prototype = room (const id::room &, const id::user &, const id::room &, const string_view &); - thread_local mods::import function + static mods::import function { "client_createroom", "createroom__parent_type" }; @@ -2414,7 +2414,7 @@ ircd::m::join(const id::room_alias &room_alias, { using prototype = event::id::buf (const id::room_alias &, const id::user &); - thread_local mods::import function + static mods::import function { "client_rooms", "join__alias_user" }; @@ -2428,7 +2428,7 @@ ircd::m::join(const room &room, { using prototype = event::id::buf (const m::room &, const id::user &); - thread_local mods::import function + static mods::import function { "client_rooms", "join__room_user" }; @@ -2442,7 +2442,7 @@ ircd::m::leave(const room &room, { using prototype = event::id::buf (const m::room &, const id::user &); - thread_local mods::import function + static mods::import function { "client_rooms", "leave__room_user" }; @@ -2457,7 +2457,7 @@ ircd::m::invite(const room &room, { using prototype = event::id::buf (const m::room &, const id::user &, const id::user &); - thread_local mods::import function + static mods::import function { "client_rooms", "invite__room_user" }; @@ -2473,7 +2473,7 @@ ircd::m::redact(const room &room, { using prototype = event::id::buf (const m::room &, const id::user &, const id::event &, const string_view &); - thread_local mods::import function + static mods::import function { "client_rooms", "redact__" }; @@ -2566,7 +2566,7 @@ ircd::m::send(const room &room, { using prototype = event::id::buf (const m::room &, const id::user &, const string_view &, const string_view &, const json::iov &); - thread_local mods::import function + static mods::import function { "client_rooms", "state__iov" }; @@ -2604,7 +2604,7 @@ ircd::m::send(const room &room, { using prototype = event::id::buf (const m::room &, const id::user &, const string_view &, const json::iov &); - thread_local mods::import function + static mods::import function { "client_rooms", "send__iov" }; @@ -2682,7 +2682,7 @@ ircd::m::count_since(const room &r, const event::idx &, const event::idx &); - thread_local mods::import _count_since + static mods::import _count_since { "m_room", "count_since" }; @@ -2726,7 +2726,7 @@ ircd::m::room_id(const mutable_buffer &out, { using prototype = id::room (const mutable_buffer &, const id::room_alias &); - thread_local mods::import function + static mods::import function { "client_directory_room", "room_id__room_alias" }; @@ -2740,7 +2740,7 @@ ircd::m::exists(const id::room_alias &room_alias, { using prototype = bool (const id::room_alias, const bool &); - thread_local mods::import function + static mods::import function { "client_directory_room", "room_alias_exists" }; diff --git a/ircd/m/room.cc b/ircd/m/room.cc index 39dfa537d..422e02e59 100644 --- a/ircd/m/room.cc +++ b/ircd/m/room.cc @@ -1797,7 +1797,7 @@ const const m::room::origins::closure &, const m::room::origins::closure_bool &); - thread_local mods::import random_origin + static mods::import random_origin { "m_room", "random_origin" }; diff --git a/modules/console.cc b/modules/console.cc index 129c31533..3f3911b0a 100644 --- a/modules/console.cc +++ b/modules/console.cc @@ -599,7 +599,7 @@ console_cmd__conf__set(opt &out, const string_view &line) const string_view &key, const string_view &val); - thread_local mods::import set_conf_item + static mods::import set_conf_item { "s_conf", "set_conf_item" }; @@ -649,7 +649,7 @@ bool console_cmd__conf__rehash(opt &out, const string_view &line) { using prototype = void (const bool &); - thread_local mods::import rehash_conf + static mods::import rehash_conf { "s_conf", "rehash_conf" }; @@ -666,7 +666,7 @@ bool console_cmd__conf__reload(opt &out, const string_view &line) { using prototype = void (); - thread_local mods::import reload_conf + static mods::import reload_conf { "s_conf", "reload_conf" }; @@ -683,7 +683,7 @@ bool console_cmd__conf__reset(opt &out, const string_view &line) { using prototype = void (); - thread_local mods::import refresh_conf + static mods::import refresh_conf { "s_conf", "refresh_conf" }; @@ -2814,7 +2814,7 @@ console_cmd__net__listen__list(opt &out, const string_view &line) { using list = std::list; - thread_local mods::import listeners + static mods::import listeners { "s_listen", "listeners" }; @@ -2872,7 +2872,7 @@ console_cmd__net__listen__load(opt &out, const string_view &line) { using prototype = bool (const string_view &); - thread_local mods::import load_listener + static mods::import load_listener { "s_listen", "load_listener" }; @@ -2895,7 +2895,7 @@ console_cmd__net__listen__unload(opt &out, const string_view &line) { using prototype = bool (const string_view &); - thread_local mods::import unload_listener + static mods::import unload_listener { "s_listen", "unload_listener" }; @@ -3089,7 +3089,7 @@ bool console_cmd__key__crt__sign(opt &out, const string_view &line) { using prototype = void (const m::event &); - thread_local mods::import create_my_key + static mods::import create_my_key { "s_keys", "create_my_key" }; @@ -3250,7 +3250,7 @@ console_cmd__stage__make_prev(opt &out, const string_view &line) const mutable_buffer &, const size_t &, const bool &); - thread_local mods::import make_prev__buf + static mods::import make_prev__buf { "m_room", "make_prev__buf" }; @@ -3298,7 +3298,7 @@ console_cmd__stage__make_auth(opt &out, const string_view &line) const vector_view &, const string_view &); - thread_local mods::import make_auth__buf + static mods::import make_auth__buf { "m_room", "make_auth__buf" }; @@ -4075,7 +4075,7 @@ console_cmd__event__fetch(opt &out, const string_view &line) const m::event::id &, const mutable_buffer &); - thread_local mods::import acquire + static mods::import acquire { "vm_fetch", "acquire" }; @@ -4605,7 +4605,7 @@ console_cmd__room__head__rebuild(opt &out, const string_view &line) }; using prototype = size_t (const m::room &); - thread_local mods::import head__rebuild + static mods::import head__rebuild { "m_room", "head__rebuild" }; @@ -4633,7 +4633,7 @@ console_cmd__room__head__add(opt &out, const string_view &line) }; using prototype = void (const m::event::id &, const db::op &, const bool &); - thread_local mods::import head__modify + static mods::import head__modify { "m_room", "head__modify" }; @@ -4657,7 +4657,7 @@ console_cmd__room__head__del(opt &out, const string_view &line) }; using prototype = void (const m::event::id &, const db::op &, const bool &); - thread_local mods::import head__modify + static mods::import head__modify { "m_room", "head__modify" }; @@ -4686,7 +4686,7 @@ console_cmd__room__herd(opt &out, const string_view &line) }; using prototype = void (const m::room &, const m::user &, const milliseconds &); - thread_local mods::import room_herd + static mods::import room_herd { "m_room", "room_herd" }; @@ -4715,7 +4715,7 @@ console_cmd__room__head__reset(opt &out, const string_view &line) }; using prototype = size_t (const m::room &); - thread_local mods::import head__reset + static mods::import head__reset { "m_room", "head__reset" }; @@ -4748,7 +4748,7 @@ console_cmd__room__complete(opt &out, const string_view &line) }; using prototype = std::pair (const m::room &); - thread_local mods::import is_complete + static mods::import is_complete { "m_room", "is_complete" }; @@ -5223,7 +5223,7 @@ console_cmd__room__state__force(opt &out, const string_view &line) }; using prototype = bool (const m::event &); - thread_local mods::import state__force_present + static mods::import state__force_present { "m_room", "state__force_present" }; @@ -5256,7 +5256,7 @@ console_cmd__room__state__rebuild__present(opt &out, const string_view &line) }; using prototype = size_t (const m::room &); - thread_local mods::import state__rebuild_present + static mods::import state__rebuild_present { "m_room", "state__rebuild_present" }; @@ -5289,7 +5289,7 @@ console_cmd__room__state__rebuild__history(opt &out, const string_view &line) }; using prototype = size_t (const m::room &); - thread_local mods::import state__rebuild_history + static mods::import state__rebuild_history { "m_room", "state__rebuild_history" }; @@ -5813,7 +5813,7 @@ console_cmd__room__purge(opt &out, const string_view &line) }; using prototype = size_t (const m::room &); - thread_local mods::import purge + static mods::import purge { "m_room", "purge" }; @@ -5846,7 +5846,7 @@ console_cmd__room__dagree(opt &out, const string_view &line) }; using prototype = size_t (const m::room &, std::vector &); - thread_local mods::import dagree_histogram + static mods::import dagree_histogram { "m_room", "dagree_histogram" }; @@ -5906,7 +5906,7 @@ console_cmd__user__register(opt &out, const string_view &line) const client *const &, const bool &); - thread_local mods::import register_user + static mods::import register_user { "client_register", "register_user" }; @@ -6467,7 +6467,7 @@ console_cmd__feds__version(opt &out, const string_view &line) const milliseconds &, const std::function &); - thread_local mods::import feds__version + static mods::import feds__version { "federation_federation", "feds__version" }; @@ -6581,7 +6581,7 @@ console_cmd__feds__event(opt &out, const string_view &line) using prototype = void (const m::event::id &, std::ostream &); - thread_local mods::import feds__event + static mods::import feds__event { "federation_federation", "feds__event" }; @@ -6617,7 +6617,7 @@ console_cmd__feds__head(opt &out, const string_view &line) const milliseconds &, const std::function &); - thread_local mods::import feds__head + static mods::import feds__head { "federation_federation", "feds__head" }; @@ -6678,7 +6678,7 @@ console_cmd__feds__auth(opt &out, const string_view &line) const milliseconds &, const std::function &); - thread_local mods::import feds__head + static mods::import feds__head { "federation_federation", "feds__head" }; @@ -6738,7 +6738,7 @@ console_cmd__feds__heads(opt &out, const string_view &line) const milliseconds &, const std::function &); - thread_local mods::import feds__head + static mods::import feds__head { "federation_federation", "feds__head" }; @@ -6825,7 +6825,7 @@ console_cmd__feds__perspective(opt &out, const string_view &line) const milliseconds &, const std::function &); - thread_local mods::import feds__perspective + static mods::import feds__perspective { "federation_federation", "feds__perspective" }; @@ -6881,7 +6881,7 @@ console_cmd__feds__backfill(opt &out, const string_view &line) const size_t &, std::ostream &); - thread_local mods::import feds__backfill + static mods::import feds__backfill { "federation_federation", "feds__backfill" }; @@ -8149,7 +8149,7 @@ console_cmd__file__room(opt &out, const string_view &line) const string_view &server, const string_view &file); - thread_local mods::import file_room_id + static mods::import file_room_id { "media_media", "file_room_id" }; @@ -8197,7 +8197,7 @@ console_cmd__file__download(opt &out, const string_view &line) const m::user::id &, const net::hostport &remote); - thread_local mods::import download + static mods::import download { "media_media", "download" }; diff --git a/modules/m_room.cc b/modules/m_room.cc index 4547655e3..e8f11e7bb 100644 --- a/modules/m_room.cc +++ b/modules/m_room.cc @@ -657,7 +657,7 @@ room_herd(const m::room &room, const milliseconds &, const std::function &); - thread_local mods::import feds__head + static mods::import feds__head { "federation_federation", "feds__head" }; diff --git a/modules/m_room_member.cc b/modules/m_room_member.cc index efaea620e..33f1c1c4b 100644 --- a/modules/m_room_member.cc +++ b/modules/m_room_member.cc @@ -89,7 +89,7 @@ _join_room_hookfn }; using invite_foreign_proto = m::event::id::buf (const m::event &); -thread_local mods::import +mods::import invite__foreign { "client_rooms", "invite__foreign" diff --git a/modules/vm.cc b/modules/vm.cc index d09fd0fe1..69a352b4c 100644 --- a/modules/vm.cc +++ b/modules/vm.cc @@ -152,7 +152,7 @@ ircd::m::vm::eval__commit_room(eval &eval, const mutable_buffer &, const size_t &, const bool &); - thread_local mods::import make_prev__buf + static mods::import make_prev__buf { "m_room", "make_prev__buf" }; @@ -185,7 +185,7 @@ ircd::m::vm::eval__commit_room(eval &eval, const vector_view &, const string_view &); - thread_local mods::import make_auth__buf + static mods::import make_auth__buf { "m_room", "make_auth__buf" };