]> granicus.if.org Git - icinga2/commitdiff
Implement support for recursive object locks
authorGunnar Beutner <gunnar@beutner.name>
Wed, 11 Nov 2015 09:21:30 +0000 (10:21 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Wed, 11 Nov 2015 09:21:30 +0000 (10:21 +0100)
fixes #10596

17 files changed:
lib/base/CMakeLists.txt
lib/base/application.cpp
lib/base/array.cpp
lib/base/configobject.cpp
lib/base/configtype.cpp
lib/base/dictionary.cpp
lib/base/object.cpp
lib/base/object.hpp
lib/base/objectlock.hpp
lib/base/thinmutex.cpp [deleted file]
lib/base/thinmutex.hpp [deleted file]
lib/base/timer.cpp
lib/config/configitem.cpp
lib/db_ido/dbtype.cpp
lib/icinga/checkable-check.cpp
lib/icinga/icingaapplication.cpp
lib/icinga/notification.cpp

index 4689c0677da37133d716f867443dc09569a5650f..9f21ae19c236fd780ec47600d303a7b4797fe5df 100644 (file)
@@ -34,7 +34,7 @@ set(base_SOURCES
   function.cpp function-script.cpp functionwrapper.cpp scriptglobal.cpp
   scriptutils.cpp serializer.cpp socket.cpp socketevents.cpp stacktrace.cpp
   statsfunction.cpp stdiostream.cpp stream.cpp streamlogger.cpp streamlogger.thpp string.cpp string-script.cpp
-  sysloglogger.cpp sysloglogger.thpp tcpsocket.cpp thinmutex.cpp threadpool.cpp timer.cpp
+  sysloglogger.cpp sysloglogger.thpp tcpsocket.cpp threadpool.cpp timer.cpp
   tlsstream.cpp tlsutility.cpp type.cpp typetype-script.cpp unixsocket.cpp utility.cpp value.cpp
   value-operators.cpp workqueue.cpp
 )
index 3866836b459f93403c56bdad5b314f23ffcdbde2..1000c1a672882d641a53f5eb28f6fffa7bc7ee41 100644 (file)
@@ -982,7 +982,6 @@ int Application::Run(void)
  */
 void Application::UpdatePidFile(const String& filename, pid_t pid)
 {
-       ASSERT(!OwnsLock());
        ObjectLock olock(this);
 
        if (m_PidFile != NULL)
@@ -1038,7 +1037,6 @@ void Application::UpdatePidFile(const String& filename, pid_t pid)
  */
 void Application::ClosePidFile(bool unlink)
 {
-       ASSERT(!OwnsLock());
        ObjectLock olock(this);
 
        if (m_PidFile != NULL)
index 638f16340fc61134f30917dad75ab7d016fbbb45..4beb809aba4bd129f64fe00a3507a8f62e12fbd2 100644 (file)
@@ -37,7 +37,6 @@ REGISTER_PRIMITIVE_TYPE(Array, Object, Array::GetPrototype());
  */
 Value Array::Get(unsigned int index) const
 {
-       ASSERT(!OwnsLock());
        ObjectLock olock(this);
 
        return m_Data.at(index);
@@ -51,7 +50,6 @@ Value Array::Get(unsigned int index) const
  */
 void Array::Set(unsigned int index, const Value& value)
 {
-       ASSERT(!OwnsLock());
        ObjectLock olock(this);
 
        m_Data.at(index) = value;
@@ -64,7 +62,6 @@ void Array::Set(unsigned int index, const Value& value)
  */
 void Array::Add(const Value& value)
 {
-       ASSERT(!OwnsLock());
        ObjectLock olock(this);
 
        m_Data.push_back(value);
@@ -77,7 +74,6 @@ void Array::Add(const Value& value)
  */
 size_t Array::GetLength(void) const
 {
-       ASSERT(!OwnsLock());
        ObjectLock olock(this);
 
        return m_Data.size();
@@ -91,7 +87,6 @@ size_t Array::GetLength(void) const
  */
 bool Array::Contains(const Value& value) const
 {
-       ASSERT(!OwnsLock());
        ObjectLock olock(this);
 
        return (std::find(m_Data.begin(), m_Data.end(), value) != m_Data.end());
@@ -105,7 +100,6 @@ bool Array::Contains(const Value& value) const
  */
 void Array::Insert(unsigned int index, const Value& value)
 {
-       ASSERT(!OwnsLock());
        ObjectLock olock(this);
 
        ASSERT(index <= m_Data.size());
@@ -120,7 +114,6 @@ void Array::Insert(unsigned int index, const Value& value)
  */
 void Array::Remove(unsigned int index)
 {
-       ASSERT(!OwnsLock());
        ObjectLock olock(this);
 
        m_Data.erase(m_Data.begin() + index);
@@ -140,7 +133,6 @@ void Array::Remove(Array::Iterator it)
 
 void Array::Resize(size_t new_size)
 {
-       ASSERT(!OwnsLock());
        ObjectLock olock(this);
 
        m_Data.resize(new_size);
@@ -148,7 +140,6 @@ void Array::Resize(size_t new_size)
 
 void Array::Clear(void)
 {
-       ASSERT(!OwnsLock());
        ObjectLock olock(this);
 
        m_Data.clear();
@@ -156,7 +147,6 @@ void Array::Clear(void)
 
 void Array::Reserve(size_t new_size)
 {
-       ASSERT(!OwnsLock());
        ObjectLock olock(this);
 
        m_Data.reserve(new_size);
@@ -164,7 +154,6 @@ void Array::Reserve(size_t new_size)
 
 void Array::CopyTo(const Array::Ptr& dest) const
 {
-       ASSERT(!OwnsLock());
        ObjectLock olock(this);
        ObjectLock xlock(dest);
 
index ff23965f247ade0206aa58c4d341efe6644a041d..9b59f69f08095f4d88062dbff77051992dee9e72 100644 (file)
@@ -378,7 +378,6 @@ void ConfigObject::Start(bool runtimeCreated)
 {
        ObjectImpl<ConfigObject>::Start(runtimeCreated);
 
-       ASSERT(!OwnsLock());
        ObjectLock olock(this);
 
        SetStartCalled(true);
@@ -388,8 +387,6 @@ void ConfigObject::Activate(bool runtimeCreated)
 {
        CONTEXT("Activating object '" + GetName() + "' of type '" + GetType()->GetName() + "'");
 
-       ASSERT(!OwnsLock());
-
        Start(runtimeCreated);
 
        ASSERT(GetStartCalled());
@@ -409,7 +406,6 @@ void ConfigObject::Stop(bool runtimeRemoved)
 {
        ObjectImpl<ConfigObject>::Stop(runtimeRemoved);
 
-       ASSERT(!OwnsLock());
        ObjectLock olock(this);
 
        SetStopCalled(true);
@@ -419,8 +415,6 @@ void ConfigObject::Deactivate(bool runtimeRemoved)
 {
        CONTEXT("Deactivating object '" + GetName() + "' of type '" + GetType()->GetName() + "'");
 
-       ASSERT(!OwnsLock());
-
        SetAuthority(false);
 
        {
index 90555f992109f8bf9175a7307ab02931f2bf0877..aede58dbe7dc2ca495339ca8ebd6aa6398ba462f 100644 (file)
@@ -28,9 +28,7 @@ using namespace icinga;
 
 ConfigType::ConfigType(const String& name)
        : m_Name(name)
-{
-       InflateMutex();
-}
+{ }
 
 ConfigType::Ptr ConfigType::GetByName(const String& name)
 {
index 372604e63b8f154272af09f5f2e5bd4d6b379485..a62bddb3d12150cbaf410822835809c6165b291d 100644 (file)
@@ -36,7 +36,6 @@ REGISTER_PRIMITIVE_TYPE(Dictionary, Object, Dictionary::GetPrototype());
  */
 Value Dictionary::Get(const String& key) const
 {
-       ASSERT(!OwnsLock());
        ObjectLock olock(this);
 
        std::map<String, Value>::const_iterator it = m_Data.find(key);
@@ -56,7 +55,6 @@ Value Dictionary::Get(const String& key) const
  */
 bool Dictionary::Get(const String& key, Value *result) const
 {
-       ASSERT(!OwnsLock());
        ObjectLock olock(this);
 
        std::map<String, Value>::const_iterator it = m_Data.find(key);
@@ -76,7 +74,6 @@ bool Dictionary::Get(const String& key, Value *result) const
  */
 void Dictionary::Set(const String& key, const Value& value)
 {
-       ASSERT(!OwnsLock());
        ObjectLock olock(this);
 
        m_Data[key] = value;
@@ -90,7 +87,6 @@ void Dictionary::Set(const String& key, const Value& value)
  */
 size_t Dictionary::GetLength(void) const
 {
-       ASSERT(!OwnsLock());
        ObjectLock olock(this);
 
        return m_Data.size();
@@ -104,7 +100,6 @@ size_t Dictionary::GetLength(void) const
  */
 bool Dictionary::Contains(const String& key) const
 {
-       ASSERT(!OwnsLock());
        ObjectLock olock(this);
 
        return (m_Data.find(key) != m_Data.end());
@@ -117,7 +112,6 @@ bool Dictionary::Contains(const String& key) const
  */
 void Dictionary::Remove(const String& key)
 {
-       ASSERT(!OwnsLock());
        ObjectLock olock(this);
 
        Dictionary::Iterator it;
@@ -134,7 +128,6 @@ void Dictionary::Remove(const String& key)
  */
 void Dictionary::Clear(void)
 {
-       ASSERT(!OwnsLock());
        ObjectLock olock(this);
 
        m_Data.clear();
@@ -142,7 +135,6 @@ void Dictionary::Clear(void)
 
 void Dictionary::CopyTo(const Dictionary::Ptr& dest) const
 {
-       ASSERT(!OwnsLock());
        ObjectLock olock(this);
 
        BOOST_FOREACH(const Dictionary::Pair& kv, m_Data) {
@@ -188,7 +180,6 @@ Object::Ptr Dictionary::Clone(void) const
  */
 std::vector<String> Dictionary::GetKeys(void) const
 {
-       ASSERT(!OwnsLock());
        ObjectLock olock(this);
 
        std::vector<String> keys;
index b15965ca76b1673089bfcaf1a410baa71cdd2ef5..267f0ddcdcdeda6ae06d9bd6ec5fe16e373e9c80 100644 (file)
@@ -71,11 +71,6 @@ bool Object::OwnsLock(void) const
 }
 #endif /* I2_DEBUG */
 
-void Object::InflateMutex(void)
-{
-       m_Mutex.Inflate();
-}
-
 void Object::SetField(int id, const Value&, bool, const Value&)
 {
        if (id == 0)
index 12bd2d6c18cb24586badaf5b5142434670bd2260..e3fb481940c0ce79fc64d2261bb7a92016fee7d7 100644 (file)
 
 #include "base/i2-base.hpp"
 #include "base/debug.hpp"
-#include "base/thinmutex.hpp"
-
-#ifndef I2_DEBUG
-#include <boost/thread/mutex.hpp>
-#else /* I2_DEBUG */
 #include <boost/thread/recursive_mutex.hpp>
-#endif /* I2_DEBUG */
-
 #include <boost/thread/condition_variable.hpp>
-
 #include <boost/smart_ptr/intrusive_ptr.hpp>
 
 using boost::intrusive_ptr;
@@ -115,8 +107,6 @@ public:
        bool OwnsLock(void) const;
 #endif /* I2_DEBUG */
 
-       void InflateMutex(void);
-
        static Object::Ptr GetPrototype(void);
        
        virtual Object::Ptr Clone(void) const;
@@ -128,7 +118,7 @@ private:
        Object& operator=(const Object& rhs);
 
        uintptr_t m_References;
-       mutable ThinMutex m_Mutex;
+       mutable boost::recursive_mutex m_Mutex;
 
 #ifdef I2_DEBUG
 #      ifndef _WIN32
index 1e4dda07bccdc1ac2b3d874ccf1fb1228c345c54..b59b65fa690399a7f7a049f99c51557c0571f5f4 100644 (file)
@@ -56,9 +56,8 @@ public:
        inline void Lock(void)
        {
                ASSERT(!m_Locked && m_Object != NULL);
-               ASSERT(!m_Object->OwnsLock());
 
-               m_Object->m_Mutex.Lock();
+               m_Object->m_Mutex.lock();
                m_Locked = true;
 
 #ifdef I2_DEBUG
@@ -83,7 +82,7 @@ public:
 #endif /* I2_DEBUG */
 
                if (m_Locked) {
-                       m_Object->m_Mutex.Unlock();
+                       m_Object->m_Mutex.unlock();
                        m_Locked = false;
                }
        }
diff --git a/lib/base/thinmutex.cpp b/lib/base/thinmutex.cpp
deleted file mode 100644 (file)
index 29f9826..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/******************************************************************************
- * Icinga 2                                                                   *
- * Copyright (C) 2012-2013 Icinga Development Team (http://www.icinga.org/)   *
- *                                                                            *
- * This program is free software; you can redistribute it and/or              *
- * modify it under the terms of the GNU General Public License                *
- * as published by the Free Software Foundation; either version 2             *
- * of the License, or (at your option) any later version.                     *
- *                                                                            *
- * This program is distributed in the hope that it will be useful,            *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *
- * GNU General Public License for more details.                               *
- *                                                                            *
- * You should have received a copy of the GNU General Public License          *
- * along with this program; if not, write to the Free Software Foundation     *
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
- ******************************************************************************/
-
-#include "base/thinmutex.hpp"
-#include "base/timer.hpp"
-#include "base/convert.hpp"
-#include "base/logger.hpp"
-
-using namespace icinga;
-
-/**
- * Locks the mutex and inflates the lock.
- */
-void ThinMutex::LockSlowPath(void)
-{
-       unsigned int it = 0;
-
-#ifdef _WIN32
-#      ifdef _WIN64
-       while (InterlockedCompareExchange64(&m_Data, THINLOCK_LOCKED, THINLOCK_UNLOCKED) != THINLOCK_UNLOCKED) {
-#      else /* _WIN64 */
-       while (InterlockedCompareExchange(&m_Data, THINLOCK_LOCKED, THINLOCK_UNLOCKED) != THINLOCK_UNLOCKED) {
-#      endif /* _WIN64 */
-#else /* _WIN32 */
-       while (!__sync_bool_compare_and_swap(&m_Data, THINLOCK_UNLOCKED, THINLOCK_LOCKED)) {
-#endif /* _WIN32 */
-               if (m_Data > THINLOCK_LOCKED) {
-                       boost::mutex *mtx = reinterpret_cast<boost::mutex *>(m_Data);
-                       mtx->lock();
-
-                       return;
-               }
-
-               Spin(it);
-               it++;
-       }
-
-       boost::mutex *mtx = new boost::mutex();
-       mtx->lock();
-#ifdef _WIN32
-#      ifdef _WIN64
-       InterlockedCompareExchange64(&m_Data, reinterpret_cast<LONGLONG>(mtx), THINLOCK_LOCKED);
-#      else /* _WIN64 */
-       InterlockedCompareExchange(&m_Data, reinterpret_cast<LONG>(mtx), THINLOCK_LOCKED);
-#      endif /* _WIN64 */
-#else /* _WIN32 */
-       __sync_bool_compare_and_swap(&m_Data, THINLOCK_LOCKED, reinterpret_cast<uintptr_t>(mtx));
-#endif /* _WIN32 */
-}
-
diff --git a/lib/base/thinmutex.hpp b/lib/base/thinmutex.hpp
deleted file mode 100644 (file)
index 6d03781..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/******************************************************************************
- * Icinga 2                                                                   *
- * Copyright (C) 2012-2013 Icinga Development Team (http://www.icinga.org/)   *
- *                                                                            *
- * This program is free software; you can redistribute it and/or              *
- * modify it under the terms of the GNU General Public License                *
- * as published by the Free Software Foundation; either version 2             *
- * of the License, or (at your option) any later version.                     *
- *                                                                            *
- * This program is distributed in the hope that it will be useful,            *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of             *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              *
- * GNU General Public License for more details.                               *
- *                                                                            *
- * You should have received a copy of the GNU General Public License          *
- * along with this program; if not, write to the Free Software Foundation     *
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.             *
- ******************************************************************************/
-
-#ifndef THINMUTEX_H
-#define THINMUTEX_H
-
-#include "base/i2-base.hpp"
-#include <boost/thread/mutex.hpp>
-#ifndef _WIN32
-#include <sched.h>
-#endif /* _WIN32 */
-
-#if defined(_MSC_VER) && _MSC_VER >= 1310 && (defined(_M_IX86) || defined(_M_X64))
-extern "C" void _mm_pause();
-#pragma intrinsic(_mm_pause)
-#define SPIN_PAUSE() _mm_pause()
-#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
-#define SPIN_PAUSE() __asm__ __volatile__("rep; nop" : : : "memory")
-#endif
-
-#define THINLOCK_UNLOCKED 0
-#define THINLOCK_LOCKED 1
-
-namespace icinga {
-
-class I2_BASE_API ThinMutex
-{
-public:
-       inline ThinMutex(void)
-               : m_Data(THINLOCK_UNLOCKED)
-       { }
-
-       inline ~ThinMutex(void)
-       {
-               if (m_Data > THINLOCK_LOCKED)
-                       delete reinterpret_cast<boost::mutex *>(m_Data);
-       }
-
-       inline void Lock(void)
-       {
-#ifdef _WIN32
-#      ifdef _WIN64
-               if (InterlockedCompareExchange64(&m_Data, THINLOCK_LOCKED, THINLOCK_UNLOCKED) != THINLOCK_UNLOCKED) {
-#      else /* _WIN64 */
-               if (InterlockedCompareExchange(&m_Data, THINLOCK_LOCKED, THINLOCK_UNLOCKED) != THINLOCK_UNLOCKED) {
-#      endif /* _WIN64 */
-#else /* _WIN32 */
-               if (!__sync_bool_compare_and_swap(&m_Data, THINLOCK_UNLOCKED, THINLOCK_LOCKED)) {
-#endif /* _WIN32 */
-                       LockSlowPath();
-               }
-       }
-
-       inline void Unlock(void)
-       {
-#ifdef _WIN32
-#      ifdef _WIN64
-               if (InterlockedCompareExchange64(&m_Data, THINLOCK_UNLOCKED, THINLOCK_LOCKED) != THINLOCK_LOCKED) {
-#      else /* _WIN64 */
-               if (InterlockedCompareExchange(&m_Data, THINLOCK_UNLOCKED, THINLOCK_LOCKED) != THINLOCK_LOCKED) {
-#      endif /* _WIN64 */
-#else /* _WIN32 */
-               if (!__sync_bool_compare_and_swap(&m_Data, THINLOCK_LOCKED, THINLOCK_UNLOCKED)) {
-#endif /* _WIN32 */
-                       boost::mutex *mtx = reinterpret_cast<boost::mutex *>(m_Data);
-                       mtx->unlock();
-               }
-       }
-
-       inline void Inflate(void)
-       {
-               LockSlowPath();
-               Unlock();
-       }
-
-private:
-       inline void Spin(unsigned int it)
-       {
-               if (it < 8) {
-                       /* Do nothing. */
-               }
-#ifdef SPIN_PAUSE
-               else if (it < 16) {
-                       SPIN_PAUSE();
-               }
-#endif /* SPIN_PAUSE */
-               else {
-#ifdef _WIN32
-                       Sleep(0);
-#else /* _WIN32 */
-                       sched_yield();
-#endif /* _WIN32 */
-               }
-       }
-
-private:
-#ifdef _WIN32
-#      ifdef _WIN64
-       LONGLONG m_Data;
-#      else /* _WIN64 */
-       LONG m_Data;
-#      endif /* _WIN64 */
-#else /* _WIN32 */
-       uintptr_t m_Data;
-#endif /* _WIN32 */
-
-       void LockSlowPath(void);
-};
-
-}
-
-#endif /* THINMUTEX_H */
index 89cb3d79fda76ed82363a2f20238d465cd490f88..8f9b3a9045b77d8b22fab57bd1471997f39610cf 100644 (file)
@@ -90,8 +90,6 @@ void Timer::Uninitialize(void)
  */
 void Timer::Call(void)
 {
-       ASSERT(!OwnsLock());
-
        try {
                OnTimerExpired(Timer::Ptr(this));
        } catch (...) {
@@ -110,8 +108,6 @@ void Timer::Call(void)
  */
 void Timer::SetInterval(double interval)
 {
-       ASSERT(!OwnsLock());
-
        boost::mutex::scoped_lock lock(l_TimerMutex);
        m_Interval = interval;
 }
@@ -123,8 +119,6 @@ void Timer::SetInterval(double interval)
  */
 double Timer::GetInterval(void) const
 {
-       ASSERT(!OwnsLock());
-
        boost::mutex::scoped_lock lock(l_TimerMutex);
        return m_Interval;
 }
@@ -134,8 +128,6 @@ double Timer::GetInterval(void) const
  */
 void Timer::Start(void)
 {
-       ASSERT(!OwnsLock());
-
        {
                boost::mutex::scoped_lock lock(l_TimerMutex);
                m_Started = true;
@@ -149,8 +141,6 @@ void Timer::Start(void)
  */
 void Timer::Stop(bool wait)
 {
-       ASSERT(!OwnsLock());
-
        if (l_StopTimerThread)
                return;
 
@@ -180,8 +170,6 @@ void Timer::Reschedule(double next)
  */
 void Timer::InternalReschedule(bool completed, double next)
 {
-       ASSERT(!OwnsLock());
-
        boost::mutex::scoped_lock lock(l_TimerMutex);
 
        if (completed)
@@ -214,8 +202,6 @@ void Timer::InternalReschedule(bool completed, double next)
  */
 double Timer::GetNext(void) const
 {
-       ASSERT(!OwnsLock());
-
        boost::mutex::scoped_lock lock(l_TimerMutex);
        return m_Next;
 }
index 621c7567546457eac7c2f282f9f5183ac138944d..4bc0e641804a52ebf112ae8df961a36c6219d714 100644 (file)
@@ -157,8 +157,6 @@ public:
  */
 ConfigObject::Ptr ConfigItem::Commit(bool discard)
 {
-       ASSERT(!OwnsLock());
-
 #ifdef I2_DEBUG
        Log(LogDebug, "ConfigItem")
            << "Commit called for ConfigItem Type=" << GetType() << ", Name=" << GetName();
index d4890b13f5167c0f720389aa14f3b28ccb46e34b..8e5284e57f7177bd4898376ad492a0166e223d51 100644 (file)
@@ -83,8 +83,6 @@ DbType::Ptr DbType::GetByID(long tid)
 
 DbObject::Ptr DbType::GetOrCreateObjectByName(const String& name1, const String& name2)
 {
-       ASSERT(!OwnsLock());
-
        ObjectLock olock(this);
 
        DbType::ObjectMap::const_iterator it = m_Objects.find(std::make_pair(name1, name2));
index 17c213191ad22f7cc39ee220ef33eb768435ccd4..39da8495cb7cea5432a597637ad22a0dc9cb4390 100644 (file)
@@ -151,7 +151,6 @@ void Checkable::ProcessCheckResult(const CheckResult::Ptr& cr, const MessageOrig
        bool reachable = IsReachable();
        bool notification_reachable = IsReachable(DependencyNotification);
 
-       ASSERT(!OwnsLock());
        ObjectLock olock(this);
 
        CheckResult::Ptr old_cr = GetLastCheckResult();
@@ -383,12 +382,10 @@ void Checkable::ExecuteRemoteCheck(const Dictionary::Ptr& resolvedMacros)
        GetCheckCommand()->Execute(this, cr, resolvedMacros, true);
 }
 
-void Checkable::ExecuteCheck()
+void Checkable::ExecuteCheck(void)
 {
        CONTEXT("Executing check for object '" + GetName() + "'");
 
-       ASSERT(!OwnsLock());
-
        UpdateNextCheck();
 
        bool reachable = IsReachable();
index 0320460c370a02474f6eacdc326fdfddf0f4157d..36543e725c6fdc22825ac512388ed87a96f32c8a 100644 (file)
@@ -125,8 +125,6 @@ int IcingaApplication::Main(void)
 
 void IcingaApplication::OnShutdown(void)
 {
-       ASSERT(!OwnsLock());
-
        {
                ObjectLock olock(this);
                l_RetentionTimer->Stop();
index d61586f273362048722c70453b7c4d23e17a8455..2b40d2215b47c8c351afbec4c67309891804b125 100644 (file)
@@ -240,8 +240,6 @@ String Notification::NotificationTypeToString(NotificationType type)
 
 void Notification::BeginExecuteNotification(NotificationType type, const CheckResult::Ptr& cr, bool force, const String& author, const String& text)
 {
-       ASSERT(!OwnsLock());
-
        Log(LogNotice, "Notification")
            << "Attempting to send notifications for notification object '" << GetName() << "'.";
 
@@ -398,8 +396,6 @@ void Notification::BeginExecuteNotification(NotificationType type, const CheckRe
 
 bool Notification::CheckNotificationUserFilters(NotificationType type, const User::Ptr& user, bool force)
 {
-       ASSERT(!OwnsLock());
-
        if (!force) {
                TimePeriod::Ptr tp = user->GetPeriod();
 
@@ -465,8 +461,6 @@ bool Notification::CheckNotificationUserFilters(NotificationType type, const Use
 
 void Notification::ExecuteNotificationHelper(NotificationType type, const User::Ptr& user, const CheckResult::Ptr& cr, bool force, const String& author, const String& text)
 {
-       ASSERT(!OwnsLock());
-
        try {
                NotificationCommand::Ptr command = GetCommand();