get_option(Opt, fun(_) -> true end, false).
init_module_db_table(Modules) ->
- catch ets:new(module_db, [named_table, public, bag]),
+ catch ets:new(module_db, [named_table, public, bag,
+ {read_concurrency, true}]),
%% Dirty hack for mod_pubsub
ets:insert(module_db, {mod_pubsub, mnesia}),
ets:insert(module_db, {mod_pubsub, sql}),
%% {stop, Reason}
%%----------------------------------------------------------------------
init([]) ->
- ets:new(hooks, [named_table]),
+ ets:new(hooks, [named_table, {read_concurrency, true}]),
{ok, #state{}}.
%%----------------------------------------------------------------------
lists:foreach(fun host_up/1, ?MYHOSTS),
ejabberd_hooks:add(host_up, ?MODULE, host_up, 10),
ejabberd_hooks:add(host_down, ?MODULE, host_down, 100),
- catch ets:new(?IQTABLE, [named_table, public, ordered_set]),
+ catch ets:new(?IQTABLE, [named_table, public, ordered_set,
+ {read_concurrency, true}]),
update_table(),
ejabberd_mnesia:create(?MODULE, iq_response,
[{ram_copies, [node()]},
init([]) ->
process_flag(trap_exit, true),
lists:foreach(fun(Mod) -> Mod:init() end, get_sm_backends()),
- ets:new(sm_iqtable, [named_table, public]),
+ ets:new(sm_iqtable, [named_table, public, {read_concurrency, true}]),
ejabberd_hooks:add(host_up, ?MODULE, host_up, 50),
ejabberd_hooks:add(host_down, ?MODULE, host_down, 60),
lists:foreach(fun host_up/1, ?MYHOSTS),
ejabberd_hooks:add(host_down, ?MODULE, stop_modules, 70),
ets:new(ejabberd_modules,
[named_table, public,
- {keypos, #ejabberd_module.module_host}]),
+ {keypos, #ejabberd_module.module_host},
+ {read_concurrency, true}]),
{ok, {{one_for_one, 10, 1}, []}}.
-spec start_child(module(), binary() | global, opts()) -> ok | {error, any()}.