From 571fa3fd4676e380cf0196e11021cec5817932ea Mon Sep 17 00:00:00 2001 From: Xavier Guimard Date: Sat, 30 Oct 2010 20:26:11 +0000 Subject: [PATCH] Share $iniObj between threads --- .../lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf.pm b/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf.pm index 2adab6d04..8c018a06b 100644 --- a/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf.pm +++ b/modules/lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf.pm @@ -24,6 +24,13 @@ our $VERSION = 0.70; our $msg; our $iniObj; +BEGIN { + eval { + require threads::shared; + threads::shared::share($iniObj); + }; +} + ## @cmethod Lemonldap::NG::Common::Conf new(hashRef arg) # Constructor. # Succeed if it has found a way to access to Lemonldap::NG configuration with @@ -187,7 +194,7 @@ sub getLocalConf { my $r = {}; $section ||= DEFAULTSECTION; - $file ||= $self->{confFile} || DEFAULTCONFFILE; + $file ||= $self->{confFile} || DEFAULTCONFFILE; $loaddefault = 1 unless ( defined $loaddefault ); my $cfg;