automake --add-missing --gnu $am_opt
echo "Running autoconf ..."
autoconf
-
- if ! patch --dry-run -p0 < libtool-pch.patch >/dev/null; then
- echo "Warning: Libtool patch did not apply cleanly."
- else
- patch -p0 < libtool-pch.patch
- fi
)
fi
done
void CompatComponent::Start(void)
{
m_StatusTimer = boost::make_shared<Timer>();
- m_StatusTimer->SetInterval(30);
+ m_StatusTimer->SetInterval(60);
m_StatusTimer->OnTimerExpired.connect(boost::bind(&CompatComponent::StatusTimerHandler, this));
m_StatusTimer->Start();
m_StatusTimer->Reschedule(0);
else
state = 1;
- if (Host::IsReachable(host))
+ if (!Host::IsReachable(host))
state = 2;
}
{
- ObjectLock olock(service);
+ ObjectLock olock(service);
fp << "\t" << "check_interval=" << service->GetCheckInterval() / 60.0 << "\n"
<< "\t" << "retry_interval=" << service->GetRetryInterval() / 60.0 << "\n"
fi
AC_MSG_RESULT($enable_debug)
-AC_MSG_CHECKING(whether to enable GCC precompiled headers)
-AC_ARG_ENABLE(pch, [ --enable-pch=[no/yes] enable GCC precompiled headers (default=no)],, enable_pch=no)
-AM_CONDITIONAL([USE_PCH], [test "x$enable_pch" = "xyes"])
-if test "x$enable_pch" = "xyes"; then
- CFLAGS="$CFLAGS -fpch-deps -fpch-preprocess -Winvalid-pch"
- CXXFLAGS="$CXXFLAGS -fpch-deps -fpch-preprocess -Winvalid-pch"
-fi
-AC_MSG_RESULT($enable_pch)
-
AS_AC_EXPAND([ICINGA_PREFIX], $prefix)
AC_DEFINE_UNQUOTED([ICINGA_PREFIX], "$ICINGA_PREFIX", [The installation prefix.])
${top_builddir}/third-party/mmatch/libmmatch.la \
${top_builddir}/third-party/cJSON/libcJSON.la \
${top_builddir}/third-party/popen-noshell/libpopen_noshell.la
-
-if USE_PCH
-BUILT_SOURCES = i2-base.h.gch
-
-i2-base.h.gch: i2-base.h
- $(AM_V_CXX)$(LTCXXCOMPILE) $(libbase_la_CPPFLAGS) -o $@ $^
-
-libbase_la_DEPENDENCIES = \
- i2-base.h.gch
-
-clean-local:
- rm -f i2-base.h.gch
-endif
double DynamicObject::m_CurrentTx = 0;
set<DynamicObject::WeakPtr> DynamicObject::m_ModifiedObjects;
boost::mutex DynamicObject::m_TransactionMutex;
-boost::once_flag DynamicObject::m_TransactionOnce;
+boost::once_flag DynamicObject::m_TransactionOnce = BOOST_ONCE_INIT;
Timer::Ptr DynamicObject::m_TransactionTimer;
signals2::signal<void (const DynamicObject::Ptr&)> DynamicObject::OnRegistered;
using namespace icinga;
-boost::once_flag Process::m_ThreadOnce;
+boost::once_flag Process::m_ThreadOnce = BOOST_ONCE_INIT;
boost::mutex Process::m_Mutex;
deque<Process::Ptr> Process::m_Tasks;
double Process::m_LastReport = 0;
libconfig_la_LIBADD = \
${top_builddir}/lib/base/libbase.la
-
-if USE_PCH
-BUILT_SOURCES += i2-config.h.gch
-
-i2-config.h.gch: i2-config.h
- $(AM_V_CXX)$(LTCXXCOMPILE) $(libconfig_la_CPPFLAGS) -o $@ $^
-
-libconfig_la_DEPENDENCIES = \
- i2-config.h.gch
-
-clean-local:
- rm -f i2-config.h.gch
-endif
-
using namespace icinga;
-boost::mutex ConfigItem::m_Mutex;
+recursive_mutex ConfigItem::m_Mutex;
ConfigItem::ItemMap ConfigItem::m_Items;
signals2::signal<void (const ConfigItem::Ptr&)> ConfigItem::OnCommitted;
signals2::signal<void (const ConfigItem::Ptr&)> ConfigItem::OnRemoved;
BOOST_THROW_EXCEPTION(runtime_error("Type '" + type + "' does not exist."));
{
- boost::mutex::scoped_lock lock(m_Mutex);
+ recursive_mutex::scoped_lock lock(m_Mutex);
/* Try to find an existing item with the same type and name. */
pair<String, String> ikey = make_pair(type, name);
*/
ConfigItem::Ptr ConfigItem::GetObject(const String& type, const String& name)
{
- {
- boost::mutex::scoped_lock lock(m_Mutex);
+ recursive_mutex::scoped_lock lock(m_Mutex);
- ConfigItem::ItemMap::iterator it;
+ ConfigItem::ItemMap::iterator it;
- it = m_Items.find(make_pair(type, name));
+ it = m_Items.find(make_pair(type, name));
- if (it != m_Items.end())
- return it->second;
- }
+ if (it != m_Items.end())
+ return it->second;
return ConfigItem::Ptr();
}
*/
void ConfigItem::UnloadUnit(const String& unit)
{
- boost::mutex::scoped_lock lock(m_Mutex);
+ recursive_mutex::scoped_lock lock(m_Mutex);
Logger::Write(LogInformation, "config", "Unloading config items from compilation unit '" + unit + "'");
set<ConfigItem::WeakPtr> m_ChildObjects; /**< Instantiated items
* that inherit from this item */
- static boost::mutex m_Mutex;
+ static recursive_mutex m_Mutex;
typedef map<pair<String, String>, ConfigItem::Ptr> ItemMap;
static ItemMap m_Items; /**< All registered configuration items. */
+
+ static ConfigItem::Ptr GetObjectUnlocked(const String& type,
+ const String& name);
};
}
${top_builddir}/lib/base/libbase.la \
${top_builddir}/lib/config/libconfig.la \
${top_builddir}/lib/remoting/libremoting.la
-
-if USE_PCH
-BUILT_SOURCES = i2-icinga.h.gch
-
-i2-icinga.h.gch: i2-icinga.h
- $(AM_V_CXX)$(LTCXXCOMPILE) $(libicinga_la_CPPFLAGS) -o $@ $^
-
-libicinga_la_DEPENDENCIES = \
- i2-icinga.h.gch
-
-clean-local:
- rm -f i2-icinga.h.gch
-endif
-
using namespace icinga;
-boost::once_flag ExternalCommandProcessor::m_InitializeOnce;
+boost::once_flag ExternalCommandProcessor::m_InitializeOnce = BOOST_ONCE_INIT;
boost::mutex ExternalCommandProcessor::m_Mutex;
map<String, ExternalCommandProcessor::Callback> ExternalCommandProcessor::m_Commands;
hc = host->GetHostCheckService();
}
+ ObjectLock olock(hc);
+
/* ignore hosts that are up */
if (hc && hc->GetState() == StateOK)
continue;
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. *
******************************************************************************/
-#include <cstdio>
-#include <iostream>
#include "i2-icinga.h"
using namespace icinga;
${top_builddir}/lib/base/libbase.la \
${top_builddir}/lib/config/libconfig.la \
${top_builddir}/lib/remoting/libremoting.la
-
-if USE_PCH
-BUILT_SOURCES = i2-python.h.gch
-
-i2-python.h.gch: i2-python.h
- $(AM_V_CXX)$(LTCXXCOMPILE) $(libpython_la_CPPFLAGS) -o $@ $^
-
-libpython_la_DEPENDENCIES = \
- i2-python.h.gch
-
-clean-local:
- rm -f i2-python.h.gch
-endif
-
endif
libremoting_la_LIBADD = \
${top_builddir}/lib/base/libbase.la \
${top_builddir}/lib/config/libconfig.la
-
-if USE_PCH
-BUILT_SOURCES = i2-remoting.h.gch
-
-i2-remoting.h.gch: i2-remoting.h
- $(AM_V_CXX)$(LTCXXCOMPILE) $(libremoting_la_CPPFLAGS) -o $@ $^
-
-libremoting_la_DEPENDENCIES = \
- i2-remoting.h.gch
-
-clean-local:
- rm -f i2-remoting.h.gch
-endif
-
+++ /dev/null
---- m4/ltmain.sh 2013-02-21 11:23:30.000000000 +0100
-+++ m4/ltmain.sh 2013-02-21 11:36:37.000000000 +0100
-@@ -2507,6 +2507,7 @@
-
- case $libobj in
- *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
-+ *.gch) obj=$libobj ;;
- *)
- func_fatal_error "cannot determine name of library object from \`$libobj'"
- ;;
-@@ -2717,7 +2718,14 @@
- fi
-
- $opt_dry_run || {
-- func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
-+ case $libobj in
-+ *.gch)
-+ ln -sF "$objdir/$objname" "$libobj"
-+ ;;
-+ *)
-+ func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
-+ ;;
-+ esac
-
- # Unlock the critical section if it was locked
- if test "$need_locks" != no; then