semId => semBinaryId and semMutexId

This commit is contained in:
Marty Kraimer
2000-01-27 19:47:32 +00:00
parent 373df816e7
commit 72328cce1b
15 changed files with 35 additions and 32 deletions

View File

@@ -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;

View File

@@ -35,7 +35,7 @@ of this distribution.
#include <errMdef.h>
#include <ellLib.h>
static semId asLock;
static semMutexId asLock;
#define LOCK semMutexMustTake(asLock)
#define UNLOCK semMutexGive(asLock)

View File

@@ -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];

View File

@@ -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.

View File

@@ -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 */

View File

@@ -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

View File

@@ -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;

View File

@@ -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")

View File

@@ -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 */

View File

@@ -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;

View File

@@ -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);
}

View File

@@ -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;

View File

@@ -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);
}

View File

@@ -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{

View File

@@ -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;