From 30b8c8717a3e10428d31bf0f1e0c34b2d459f9a3 Mon Sep 17 00:00:00 2001 From: Jure Varlec Date: Wed, 12 Jun 2024 16:05:02 -0400 Subject: [PATCH] Remove use of atomics, not available on EPICS 3.14 --- asyn/asynPortDriver/asynPortDriver.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/asyn/asynPortDriver/asynPortDriver.cpp b/asyn/asynPortDriver/asynPortDriver.cpp index a34d7438..f73554ff 100644 --- a/asyn/asynPortDriver/asynPortDriver.cpp +++ b/asyn/asynPortDriver/asynPortDriver.cpp @@ -18,7 +18,6 @@ #include #include -#include #include #include /* NOTE: interruptAccept is define in dbAccess.h if using EPICS IOC, else set it to 1 */ @@ -4128,7 +4127,10 @@ asynStatus asynPortDriver::createParams() /** Returns `true` when the port is destructible and `shutdown()` wasn't run yet. */ bool asynPortDriver::needsShutdown() { - return epics::atomic::get(shutdownNeeded); + lock(); + bool ret = shutdownNeeded; + unlock(); + return ret; } /** Performs cleanup that cannot be done in a destructor. @@ -4149,8 +4151,8 @@ void asynPortDriver::shutdownPortDriver() { // Which would leave a "working" port with dangling references. So let's // disarm the exception callback (because we are already being destroyed) // and shutdown the port. - if (needsShutdown()) { - epics::atomic::set(shutdownNeeded, 0); + if (shutdownNeeded) { + shutdownNeeded = 0; asynStatus status = pasynManager->shutdownPort(pasynUserSelf); if(status != asynSuccess) { printf("%s\n", pasynUserSelf->errorMessage);