From 243baddbf62f41bf0e7ef67fa84e32b5c40b64b7 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Fri, 4 May 2012 13:38:59 -0500 Subject: [PATCH] Add an Init stat to all thread control variables This makes the uninitilized value not the Run state. --- src/db/dbCa.c | 4 ++-- src/db/dbScan.c | 4 ++-- src/libCom/taskwd/taskwd.c | 4 ++-- src/rsrv/server.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/db/dbCa.c b/src/db/dbCa.c index 9f90dabc0..22870ba30 100644 --- a/src/db/dbCa.c +++ b/src/db/dbCa.c @@ -59,8 +59,8 @@ static epicsEventId workListEvent; /*wakeup event for dbCaTask*/ static int removesOutstanding = 0; #define removesOutstandingWarning 10000 -static enum { - ctlRun, ctlPause, ctlExit +static volatile enum { + ctlInit, ctlRun, ctlPause, ctlExit } dbCaCtl; static epicsEventId startStopEvent; diff --git a/src/db/dbScan.c b/src/db/dbScan.c index 5a372d6a9..a6dec93a9 100644 --- a/src/db/dbScan.c +++ b/src/db/dbScan.c @@ -50,12 +50,12 @@ /* Task Control */ -enum ctl {ctlRun, ctlPause, ctlExit}; +enum ctl {ctlInit, ctlRun, ctlPause, ctlExit}; /* Task Startup/Shutdown Synchronization */ static epicsEventId startStopEvent; -volatile enum ctl scanCtl; +static volatile enum ctl scanCtl; /* SCAN ONCE */ diff --git a/src/libCom/taskwd/taskwd.c b/src/libCom/taskwd/taskwd.c index b77361236..c034e1828 100644 --- a/src/libCom/taskwd/taskwd.c +++ b/src/libCom/taskwd/taskwd.c @@ -69,8 +69,8 @@ static epicsMutexId fLock; static ELLLIST fList = ELLLIST_INIT; /* Watchdog task control */ -static enum { - twdctlRun, twdctlDisable, twdctlExit +static volatile enum { + twdctlInit, twdctlRun, twdctlDisable, twdctlExit } twdCtl; static epicsEventId loopEvent; static epicsEventId exitEvent; diff --git a/src/rsrv/server.h b/src/rsrv/server.h index 6d1dfc38f..9c222d09b 100644 --- a/src/rsrv/server.h +++ b/src/rsrv/server.h @@ -138,7 +138,7 @@ struct event_ext { }; -enum ctl {ctlRun, ctlPause, ctlExit}; +enum ctl {ctlInit, ctlRun, ctlPause, ctlExit}; /* NOTE: external used so they remember the state across loads */ #ifdef GLBLSOURCE