fixed compilation error if InterlockedExchangePointer is a macro
authorVictor Kirhenshtein <victor@netxms.org>
Sun, 24 Sep 2017 21:35:17 +0000 (00:35 +0300)
committerVictor Kirhenshtein <victor@netxms.org>
Sun, 24 Sep 2017 21:35:17 +0000 (00:35 +0300)
include/nxatomic.h
src/libnetxms/log.cpp

index a2ec08c..82f5e5a 100644 (file)
@@ -253,7 +253,7 @@ inline void *InterlockedExchangePointer(void* volatile *target, void *value)
 /**
  * Atomically set pointer - helper template
  */
-template<typename T> T *InterlockedExchangePointer(T* volatile *target, T *value)
+template<typename T> T *InterlockedExchangeObjectPointer(T* volatile *target, T *value)
 {
    return static_cast<T*>(InterlockedExchangePointer(reinterpret_cast<void* volatile *>(target), value));
 }
index 0ed0c57..db9566c 100644 (file)
@@ -68,7 +68,7 @@ static MUTEX m_mutexDebugTagTreeWrite = INVALID_MUTEX_HANDLE;
  */
 static inline void swapAndWait()
 {
-   tagTreeSecondary = InterlockedExchangePointer(&tagTreeActive, tagTreeSecondary);
+   tagTreeSecondary = InterlockedExchangeObjectPointer(&tagTreeActive, tagTreeSecondary);
    ThreadSleepMs(10);
 
    // Wait for tree reader count to drop to 0