From 72328cce1b5b14ae50cf68d54be7e337c975fef7 Mon Sep 17 00:00:00 2001 From: Marty Kraimer Date: Thu, 27 Jan 2000 19:47:32 +0000 Subject: [PATCH] semId => semBinaryId and semMutexId --- src/as/asCa.c | 8 ++++---- src/as/asLibRoutines.c | 2 +- src/db/callback.c | 2 +- src/db/dbBkpt.c | 5 ++++- src/db/dbBkpt.h | 2 +- src/db/dbCa.c | 4 ++-- src/db/dbCa.h | 2 +- src/db/dbCommon.dbd | 2 +- src/db/dbEvent.h | 6 +++--- src/db/dbLock.c | 4 ++-- src/db/dbNotify.c | 6 +++--- src/db/dbScan.c | 4 ++-- src/db/dbTest.c | 2 +- src/db/taskwd.c | 6 +++--- src/rsrv/server.h | 12 ++++++------ 15 files changed, 35 insertions(+), 32 deletions(-) diff --git a/src/as/asCa.c b/src/as/asCa.c index f31956e35..725ce1f79 100644 --- a/src/as/asCa.c +++ b/src/as/asCa.c @@ -43,10 +43,10 @@ epicsShareExtern ASBASE volatile *pasbase; LOCAL int firstTime = TRUE; LOCAL threadId threadid=0; LOCAL int caInitializing=FALSE; -LOCAL semId asCaTaskLock; /*lock access to task */ -LOCAL semId asCaTaskWait; /*Wait for task to respond*/ -LOCAL semId asCaTaskAddChannels; /*Tell asCaTask to add channels*/ -LOCAL semId asCaTaskClearChannels; /*Tell asCaTask to clear channels*/ +LOCAL semMutexId asCaTaskLock; /*lock access to task */ +LOCAL semBinaryId asCaTaskWait; /*Wait for task to respond*/ +LOCAL semBinaryId asCaTaskAddChannels; /*Tell asCaTask to add channels*/ +LOCAL semBinaryId asCaTaskClearChannels;/*Tell asCaTask to clear channels*/ typedef struct { struct dbr_sts_double rtndata; diff --git a/src/as/asLibRoutines.c b/src/as/asLibRoutines.c index 6f114ca08..2cdae43df 100644 --- a/src/as/asLibRoutines.c +++ b/src/as/asLibRoutines.c @@ -35,7 +35,7 @@ of this distribution. #include #include -static semId asLock; +static semMutexId asLock; #define LOCK semMutexMustTake(asLock) #define UNLOCK semMutexGive(asLock) diff --git a/src/db/callback.c b/src/db/callback.c index 04e2d9c10..9b4e87f84 100644 --- a/src/db/callback.c +++ b/src/db/callback.c @@ -32,7 +32,7 @@ of this distribution. #include "dbLock.h" int callbackQueueSize = 2000; -static semId callbackSem[NUM_CALLBACK_PRIORITIES]; +static semBinaryId callbackSem[NUM_CALLBACK_PRIORITIES]; static ringId callbackQ[NUM_CALLBACK_PRIORITIES]; static threadId callbackTaskId[NUM_CALLBACK_PRIORITIES]; static int ringOverflow[NUM_CALLBACK_PRIORITIES]; diff --git a/src/db/dbBkpt.c b/src/db/dbBkpt.c index 154cee29d..917fc1a64 100644 --- a/src/db/dbBkpt.c +++ b/src/db/dbBkpt.c @@ -14,6 +14,9 @@ of this distribution. /* Modification Log: * ----------------- * $Log$ + * Revision 1.13 2000/01/24 20:58:12 mrk + * new way to build + * * Revision 1.12 2000/01/04 20:26:16 mrk * replace osiClock calls with tsStamp calls * @@ -171,7 +174,7 @@ long lset_stack_not_empty = 0; * operating with this stack. */ static ELLLIST lset_stack; -static semId bkpt_stack_sem; +static semMutexId bkpt_stack_sem; /* * Stores the last lockset continued or stepped from. diff --git a/src/db/dbBkpt.h b/src/db/dbBkpt.h index 9c754bf96..793a24720 100644 --- a/src/db/dbBkpt.h +++ b/src/db/dbBkpt.h @@ -74,7 +74,7 @@ struct LS_LIST { struct dbCommon *current_ep; /* current entrypoint */ ELLLIST bp_list; /* list of records containing breakpoints in a lockset */ ELLLIST ep_queue; /* queue of entrypoints found so far */ - semId ex_sem; /* semaphore for execution queue */ + semBinaryId ex_sem; /* semaphore for execution queue */ threadId taskid; /* saved taskid for the task in stepping mode */ int step; /* one if currently "stepping," else zero */ unsigned long l_num; /* lockset number */ diff --git a/src/db/dbCa.c b/src/db/dbCa.c index 9f8b3d8bc..09ca49093 100644 --- a/src/db/dbCa.c +++ b/src/db/dbCa.c @@ -49,8 +49,8 @@ void scanOnce(void *precord); extern volatile int interruptAccept; static ELLLIST caList; /* Work list for dbCaTask */ -static semId caListSem; /*Mutual exclusions semaphores for caList*/ -static semId caWakeupSem; /*wakeup semaphore for dbCaTask*/ +static semMutexId caListSem; /*Mutual exclusions semaphores for caList*/ +static semBinaryId caWakeupSem; /*wakeup semaphore for dbCaTask*/ void dbCaTask(void); /*The Channel Access Task*/ /* caLink locking diff --git a/src/db/dbCa.h b/src/db/dbCa.h index 68e75f5e0..9edeccd9b 100644 --- a/src/db/dbCa.h +++ b/src/db/dbCa.h @@ -51,7 +51,7 @@ typedef struct caLink char *pputString; caAttributes *pcaAttributes; long nelements; - semId lock; + semMutexId lock; unsigned long nDisconnect; unsigned long nNoWrite; short dbrType; diff --git a/src/db/dbCommon.dbd b/src/db/dbCommon.dbd index 55c9ae690..1a1bb9721 100644 --- a/src/db/dbCommon.dbd +++ b/src/db/dbCommon.dbd @@ -70,7 +70,7 @@ prompt("Monitor lock") special(SPC_NOMOD) interest(4) - extra("semId mlok") + extra("semMutexId mlok") } field(MLIS,DBF_NOACCESS) { prompt("Monitor List") diff --git a/src/db/dbEvent.h b/src/db/dbEvent.h index b823034e2..256623cd0 100644 --- a/src/db/dbEvent.h +++ b/src/db/dbEvent.h @@ -71,7 +71,7 @@ struct event_block{ struct event_que{ /* lock writers to the ring buffer only */ /* readers must never slow up writers */ - semId writelock; + semMutexId writelock; db_field_log valque[EVENTQUESIZE]; struct event_block *evque[EVENTQUESIZE]; struct event_que *nextque; /* in case que quota exceeded */ @@ -88,8 +88,8 @@ typedef void EXTRALABORFUNC (void *extralabor_arg); struct event_user { struct event_que firstque; /* the first event que */ - semId ppendsem; /* Wait while empty */ - semId pflush_sem; /* wait for flush */ + semBinaryId ppendsem; /* Wait while empty */ + semBinaryId pflush_sem; /* wait for flush */ OVRFFUNC *overflow_sub; /* called when overflow detect */ void *overflow_arg; /* parameter to above */ diff --git a/src/db/dbLock.c b/src/db/dbLock.c index 195962fbd..f9a50a3d1 100644 --- a/src/db/dbLock.c +++ b/src/db/dbLock.c @@ -85,14 +85,14 @@ since this will delay all other threads. STATIC int lockListInitialized = FALSE; STATIC ELLLIST lockList; -STATIC semId globalLock; +STATIC semMutexId globalLock; STATIC unsigned long id = 0; STATIC volatile int changingLockSets = FALSE; typedef struct lockSet { ELLNODE node; ELLLIST recordList; - semId lock; + semMutexId lock; TS_STAMP start_time; threadId thread_id; dbCommon *precord; diff --git a/src/db/dbNotify.c b/src/db/dbNotify.c index 4a4c62ccb..5c96eafe1 100644 --- a/src/db/dbNotify.c +++ b/src/db/dbNotify.c @@ -219,7 +219,7 @@ static void notifyCallback(CALLBACK *pcallback) dbScanUnlock(precord); ppn->restart = FALSE; ppn->callbackState = callbackNotActive; - semBinaryGive((semId)ppn->waitForCallback); + semBinaryGive((semBinaryId)ppn->waitForCallback); return; } if(ppn->callbackState==callbackActive) { @@ -250,11 +250,11 @@ void dbNotifyCancel(PUTNOTIFY *ppn) ppn->waitForCallback = (void *)semBinaryMustCreate(semFull); ppn->callbackState = callbackCanceled; dbScanUnlock(precord); - if(semBinaryTakeTimeout((semId)ppn->waitForCallback,10.0)!=semTakeOK) { + if(semBinaryTakeTimeout((semBinaryId)ppn->waitForCallback,10.0)!=semTakeOK) { errlogPrintf("dbNotifyCancel had semTake timeout\n"); ppn->callbackState = callbackNotActive; } - semBinaryDestroy((semId)ppn->waitForCallback); + semBinaryDestroy((semBinaryId)ppn->waitForCallback); } else { dbScanUnlock(precord); } diff --git a/src/db/dbScan.c b/src/db/dbScan.c index bb85c684b..9924f3230 100644 --- a/src/db/dbScan.c +++ b/src/db/dbScan.c @@ -75,13 +75,13 @@ extern struct dbBase *pdbbase; /* SCAN ONCE */ int onceQueueSize = 1000; -static semId onceSem; +static semBinaryId onceSem; static ringId onceQ; static threadId onceTaskId; /*all other scan types */ typedef struct scan_list{ - semId lock; + semMutexId lock; ELLLIST list; short modified;/*has list been modified?*/ double rate; diff --git a/src/db/dbTest.c b/src/db/dbTest.c index 7beb96847..5bf6a822e 100644 --- a/src/db/dbTest.c +++ b/src/db/dbTest.c @@ -441,7 +441,7 @@ long dbtr(char *pname) return(1); } if(semMutexTakeNoWait(precord->mlok)==semTakeOK) { - semBinaryGive(precord->mlok); + semMutexGive(precord->mlok); printf("record locked\n"); return(1); } diff --git a/src/db/taskwd.c b/src/db/taskwd.c index bb98a09fe..8642f3aef 100644 --- a/src/db/taskwd.c +++ b/src/db/taskwd.c @@ -59,9 +59,9 @@ struct task_list { static ELLLIST list; static ELLLIST anylist; -static semId lock; -static semId anylock; -static semId alloclock; +static semMutexId lock; +static semMutexId anylock; +static semMutexId alloclock; static threadId taskwdid=0; volatile int taskwdOn=TRUE; struct freeList{ diff --git a/src/rsrv/server.h b/src/rsrv/server.h index 83679d25d..284cbbaa8 100644 --- a/src/rsrv/server.h +++ b/src/rsrv/server.h @@ -117,10 +117,10 @@ struct client{ ELLNODE node; struct message_buffer send; struct message_buffer recv; - semId lock; - semId putNotifyLock; - semId addrqLock; - semId eventqLock; + semMutexId lock; + semMutexId putNotifyLock; + semMutexId addrqLock; + semMutexId eventqLock; ELLLIST addrq; ELLLIST putNotifyQue; struct sockaddr_in addr; @@ -130,7 +130,7 @@ struct client{ void *evuser; char *pUserName; char *pHostName; - semId blockSem; /* used whenever the client blocks */ + semBinaryId blockSem; /* used whenever the client blocks */ SOCKET sock; int proto; threadId tid; @@ -222,7 +222,7 @@ GLBLTYPE SOCKET IOC_cast_sock; GLBLTYPE unsigned short ca_server_port; GLBLTYPE ELLLIST clientQ; /* locked by clientQlock */ GLBLTYPE ELLLIST beaconAddrList; -GLBLTYPE semId clientQlock; +GLBLTYPE semMutexId clientQlock; GLBLTYPE struct client *prsrv_cast_client; GLBLTYPE BUCKET *pCaBucket; GLBLTYPE void *rsrvClientFreeList;