From bc5cc3fa29950cc62eb0c5f3ad944d64305e6059 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Thu, 27 Aug 2020 18:21:46 +0200 Subject: [PATCH] stopping in virtual server needs a usleep before acquiring lock to get status --- slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c | 2 +- .../eigerDetectorServer/slsDetectorFunctionList.c | 2 +- .../gotthard2DetectorServer/slsDetectorFunctionList.c | 2 +- .../gotthardDetectorServer/slsDetectorFunctionList.c | 2 +- .../jungfrauDetectorServer/slsDetectorFunctionList.c | 2 +- .../moenchDetectorServer/slsDetectorFunctionList.c | 2 +- .../mythen3DetectorServer/slsDetectorFunctionList.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c index 3a7620fbc..82b4445bf 100644 --- a/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c @@ -2347,7 +2347,7 @@ int stopStateMachine() { sharedMemory_setStop(1); // read till status is idle while (sharedMemory_getStatus() == RUNNING) - ; + usleep(500); sharedMemory_setStop(0); LOG(logINFO, ("Stopped State Machine\n")); return OK; diff --git a/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c index a54601d59..e15b9cd4b 100644 --- a/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/eigerDetectorServer/slsDetectorFunctionList.c @@ -2217,7 +2217,7 @@ int stopStateMachine() { sharedMemory_setStop(1); // read till status is idle while (sharedMemory_getStatus() == RUNNING) - ; + usleep(500); sharedMemory_setStop(0); LOG(logINFO, ("Stopped State Machine\n")); return OK; diff --git a/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c index 0476d35a9..2fe739003 100644 --- a/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c @@ -2556,7 +2556,7 @@ int stopStateMachine() { #ifdef VIRTUAL sharedMemory_setStop(1); while (sharedMemory_getStatus() == RUNNING) - ; + usleep(500); sharedMemory_setStop(0); LOG(logINFO, ("Stopped State Machine\n")); return OK; diff --git a/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c index 6380fd9d4..efb363500 100644 --- a/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/gotthardDetectorServer/slsDetectorFunctionList.c @@ -1630,7 +1630,7 @@ int stopStateMachine() { sharedMemory_setStop(1); // read till status is idle while (sharedMemory_getStatus() == RUNNING) - ; + usleep(500); sharedMemory_setStop(0); LOG(logINFO, ("Stopped State Machine\n")); } diff --git a/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c index a46ec68cc..1abd28024 100644 --- a/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c @@ -1818,7 +1818,7 @@ int stopStateMachine() { sharedMemory_setStop(1); // read till status is idle while (sharedMemory_getStatus() == RUNNING) - ; + usleep(500); sharedMemory_setStop(0); LOG(logINFO, ("Stopped State Machine\n")); return OK; diff --git a/slsDetectorServers/moenchDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/moenchDetectorServer/slsDetectorFunctionList.c index 9d1dd562e..a31dec027 100644 --- a/slsDetectorServers/moenchDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/moenchDetectorServer/slsDetectorFunctionList.c @@ -1980,7 +1980,7 @@ int stopStateMachine() { sharedMemory_setStop(1); // read till status is idle while (sharedMemory_getStatus() == RUNNING) - ; + usleep(500); sharedMemory_setStop(0); LOG(logINFO, ("Stopped State Machine\n")); return OK; diff --git a/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c index e3347a839..1e624f57d 100644 --- a/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/mythen3DetectorServer/slsDetectorFunctionList.c @@ -2261,7 +2261,7 @@ int stopStateMachine() { sharedMemory_setStop(1); // read till status is idle while (sharedMemory_getStatus() == RUNNING) - ; + usleep(500); sharedMemory_setStop(0); LOG(logINFO, ("Stopped State Machine\n")); }