From afec054544b2ac2945fd0576a30f48f1567471c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micka=C3=ABl=20R=C3=A9mond?= Date: Fri, 14 Sep 2007 14:16:36 +0000 Subject: * src/ejabberd_c2s.erl: Option to prevent the use of Erlang OTP supervisor for transient processes (EJAB-354). * src/ejabberd_s2s_in.erl: Likewise. * src/ejabberd_s2s_out.erl: Likewise. * src/mod_muc/mod_muc_room.erl: Likewise. * src/configure.ac: Likewise. * src/configure: Likewise. * src/Makefile.in: Likewise. * src/mod_muc/Makefile.in: Likewise. SVN Revision: 931 --- src/mod_muc/Makefile.in | 5 +++++ src/mod_muc/mod_muc_room.erl | 18 ++++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) (limited to 'src/mod_muc') diff --git a/src/mod_muc/Makefile.in b/src/mod_muc/Makefile.in index 6b303d702..4e5d728ea 100644 --- a/src/mod_muc/Makefile.in +++ b/src/mod_muc/Makefile.in @@ -15,6 +15,11 @@ ifdef debug EFLAGS+=+debug_info endif +ifeq (@transient_supervisors@, false) + EFLAGS+=-DNO_TRANSIENT_SUPERVISORS +endif + + OBJS = \ $(OUTDIR)/mod_muc.beam \ $(OUTDIR)/mod_muc_log.beam \ diff --git a/src/mod_muc/mod_muc_room.erl b/src/mod_muc/mod_muc_room.erl index fccd09cbd..7fbaf555a 100644 --- a/src/mod_muc/mod_muc_room.erl +++ b/src/mod_muc/mod_muc_room.erl @@ -94,16 +94,26 @@ -define(FSMOPTS, []). -endif. +%% Module start with or without supervisor: +-ifdef(NO_TRANSIENT_SUPERVISORS). +-define(SUPERVISOR_START, + gen_fsm:start(?MODULE, [Host, ServerHost, Access, Room, HistorySize, + RoomShaper, Creator, Nick, DefRoomOpts], + ?FSMOPTS)). +-else. +-define(SUPERVISOR_START, + Supervisor = gen_mod:get_module_proc(ServerHost, ejabberd_mod_muc_sup), + supervisor:start_child( + Supervisor, [Host, ServerHost, Access, Room, HistorySize, RoomShaper, + Creator, Nick, DefRoomOpts])). +-endif. %%%---------------------------------------------------------------------- %%% API %%%---------------------------------------------------------------------- start(Host, ServerHost, Access, Room, HistorySize, RoomShaper, Creator, Nick, DefRoomOpts) -> - Supervisor = gen_mod:get_module_proc(ServerHost, ejabberd_mod_muc_sup), - supervisor:start_child( - Supervisor, [Host, ServerHost, Access, Room, HistorySize, RoomShaper, - Creator, Nick, DefRoomOpts]). + ?SUPERVISOR_START. start(Host, ServerHost, Access, Room, HistorySize, RoomShaper, Opts) -> Supervisor = gen_mod:get_module_proc(ServerHost, ejabberd_mod_muc_sup), -- cgit v1.2.3