1 From 26b0002d2c181ca4e4b4ca5b253540b428273291 Mon Sep 17 00:00:00 2001
2 From: Philipp Kerling <yol@casix.org>
3 Date: Sat, 11 May 2024 00:44:57 +0200
4 Subject: [PATCH 3/8] libUPnP: Remove deprecated volatile usage
6 With the atomic_int, the mutex is no longer necessary as well.
8 .../Neptune/Source/System/Posix/NptPosixThreads.cpp | 13 ++-----------
9 1 file changed, 2 insertions(+), 11 deletions(-)
11 diff --git a/lib/libUPnP/Neptune/Source/System/Posix/NptPosixThreads.cpp b/lib/libUPnP/Neptune/Source/System/Posix/NptPosixThreads.cpp
12 index 510d3e9fbd..47ccd48241 100644
13 --- a/lib/libUPnP/Neptune/Source/System/Posix/NptPosixThreads.cpp
14 +++ b/lib/libUPnP/Neptune/Source/System/Posix/NptPosixThreads.cpp
16 #if defined(__SYMBIAN32__)
23 @@ -278,8 +279,7 @@ class NPT_PosixAtomicVariable : public NPT_AtomicVariableInterface
27 - volatile int m_Value;
28 - pthread_mutex_t m_Mutex;
29 + std::atomic_int m_Value;
32 /*----------------------------------------------------------------------
33 @@ -288,7 +288,6 @@ class NPT_PosixAtomicVariable : public NPT_AtomicVariableInterface
34 NPT_PosixAtomicVariable::NPT_PosixAtomicVariable(int value) :
37 - pthread_mutex_init(&m_Mutex, NULL);
40 /*----------------------------------------------------------------------
41 @@ -296,7 +295,6 @@ NPT_PosixAtomicVariable::NPT_PosixAtomicVariable(int value) :
42 +---------------------------------------------------------------------*/
43 NPT_PosixAtomicVariable::~NPT_PosixAtomicVariable()
45 - pthread_mutex_destroy(&m_Mutex);
48 /*----------------------------------------------------------------------
49 @@ -307,9 +305,7 @@ NPT_PosixAtomicVariable::Increment()
53 - pthread_mutex_lock(&m_Mutex);
55 - pthread_mutex_unlock(&m_Mutex);
59 @@ -322,9 +318,7 @@ NPT_PosixAtomicVariable::Decrement()
63 - pthread_mutex_lock(&m_Mutex);
65 - pthread_mutex_unlock(&m_Mutex);
69 @@ -335,7 +329,6 @@ NPT_PosixAtomicVariable::Decrement()
71 NPT_PosixAtomicVariable::GetValue()
73 - // we assume that int read/write are atomic on the platform
77 @@ -345,9 +338,7 @@ NPT_PosixAtomicVariable::GetValue()
79 NPT_PosixAtomicVariable::SetValue(int value)
81 - pthread_mutex_lock(&m_Mutex);
83 - pthread_mutex_unlock(&m_Mutex);
86 /*----------------------------------------------------------------------