Only ignore errors when there is an error reporting path
can't report from thread free mutex unlock or implicit thread creation
This commit is contained in:
@@ -160,8 +160,7 @@ mySend(epicsMessageQueueId pmsg, void *message, unsigned int size, bool wait, bo
|
||||
/*
|
||||
* See if message can be sent
|
||||
*/
|
||||
if(epicsMutexLock(pmsg->mutex)!=epicsMutexLockOK)
|
||||
return -1;
|
||||
epicsMutexMustLock(pmsg->mutex);
|
||||
|
||||
if ((pmsg->numberOfSendersWaiting > 0)
|
||||
|| (pmsg->full && (ellFirst(&pmsg->receiveQueue) == NULL))) {
|
||||
@@ -194,10 +193,7 @@ mySend(epicsMessageQueueId pmsg, void *message, unsigned int size, bool wait, bo
|
||||
else
|
||||
epicsEventWait(threadNode.evp->event);
|
||||
|
||||
if(epicsMutexLock(pmsg->mutex)!=epicsMutexLockOK){
|
||||
freeEventNode(threadNode.evp);
|
||||
return -1;
|
||||
}
|
||||
epicsMutexMustLock(pmsg->mutex);
|
||||
|
||||
if(!threadNode.eventSent)
|
||||
ellDelete(&pmsg->sendQueue, &threadNode.link);
|
||||
@@ -270,8 +266,8 @@ myReceive(epicsMessageQueueId pmsg, void *message, unsigned int size, bool wait,
|
||||
/*
|
||||
* If there's a message on the queue, copy it
|
||||
*/
|
||||
if(epicsMutexLock(pmsg->mutex)!=epicsMutexLockOK)
|
||||
return -1;
|
||||
epicsMutexMustLock(pmsg->mutex);
|
||||
|
||||
|
||||
myOutPtr = (char *)pmsg->outPtr;
|
||||
if ((myOutPtr != pmsg->inPtr) || pmsg->full) {
|
||||
@@ -341,10 +337,7 @@ myReceive(epicsMessageQueueId pmsg, void *message, unsigned int size, bool wait,
|
||||
else
|
||||
epicsEventWait(threadNode.evp->event);
|
||||
|
||||
if(epicsMutexLock(pmsg->mutex)!=epicsMutexLockOK){
|
||||
freeEventNode(threadNode.evp);
|
||||
return -1;
|
||||
}
|
||||
epicsMutexMustLock(pmsg->mutex);
|
||||
|
||||
if(!threadNode.eventSent)
|
||||
ellDelete(&pmsg->receiveQueue, &threadNode.link);
|
||||
|
||||
@@ -245,7 +245,7 @@ void epicsMutexOsdUnlock(struct epicsMutexOSD * pmutex)
|
||||
pmutex->owned = 0;
|
||||
pmutex->ownerTid = 0;
|
||||
status = pthread_cond_signal(&pmutex->waitToBeOwner);
|
||||
checkStatus(status, "pthread_cond_signal epicsMutexOsdUnlock");
|
||||
checkStatusQuit(status, "pthread_cond_signal epicsMutexOsdUnlock", "epicsMutexOsdUnlock");
|
||||
}
|
||||
|
||||
status = pthread_mutex_unlock(&pmutex->lock);
|
||||
|
||||
@@ -199,17 +199,13 @@ static void free_threadInfo(epicsThreadOSD *pthreadInfo)
|
||||
int status;
|
||||
|
||||
status = mutexLock(&listLock);
|
||||
checkStatus(status,"pthread_mutex_lock free_threadInfo");
|
||||
if(status)
|
||||
return;
|
||||
checkStatusQuit(status,"pthread_mutex_lock","free_threadInfo");
|
||||
if(pthreadInfo->isOnThreadList) ellDelete(&pthreadList,&pthreadInfo->node);
|
||||
status = pthread_mutex_unlock(&listLock);
|
||||
checkStatus(status,"pthread_mutex_unlock free_threadInfo");
|
||||
checkStatusQuit(status,"pthread_mutex_unlock","free_threadInfo");
|
||||
epicsEventDestroy(pthreadInfo->suspendEvent);
|
||||
status = pthread_attr_destroy(&pthreadInfo->attr);
|
||||
checkStatus(status,"pthread_attr_destroy free_threadInfo");
|
||||
if(status)
|
||||
return;
|
||||
checkStatusQuit(status,"pthread_attr_destroy","free_threadInfo");
|
||||
free(pthreadInfo);
|
||||
}
|
||||
|
||||
@@ -437,8 +433,7 @@ static epicsThreadOSD *createImplicit(void)
|
||||
tid = pthread_self();
|
||||
sprintf(name, "non-EPICS_%d", (int)tid);
|
||||
pthreadInfo = create_threadInfo(name);
|
||||
if(!pthreadInfo)
|
||||
return NULL;
|
||||
assert(pthreadInfo);
|
||||
pthreadInfo->tid = tid;
|
||||
pthreadInfo->osiPriority = 0;
|
||||
#if defined (_POSIX_THREAD_PRIORITY_SCHEDULING)
|
||||
|
||||
Reference in New Issue
Block a user