make casStatsFetch() safe-ish when RSRV not initialized
Maybe too early. Or maybe RSRV disabled via dbServer.
This commit is contained in:
@ -163,6 +163,8 @@ void camsgtask ( void *pParm )
|
||||
|
||||
int casClientInitiatingCurrentThread ( char * pBuf, size_t bufSize )
|
||||
{
|
||||
if ( ! rsrvCurrentClient )
|
||||
return RSRV_ERROR; /* not yet initialized, or disabled via dbServer */
|
||||
struct client * pClient = ( struct client * )
|
||||
epicsThreadPrivateGet ( rsrvCurrentClient );
|
||||
|
||||
|
@ -1536,6 +1536,13 @@ struct client *create_tcp_client (SOCKET sock , const osiSockAddr *peerAddr)
|
||||
|
||||
void casStatsFetch ( unsigned *pChanCount, unsigned *pCircuitCount )
|
||||
{
|
||||
if(!clientQlock) { /* not yet initialized, or disabled via dbServer */
|
||||
if(pChanCount)
|
||||
*pChanCount = 0;
|
||||
if(pCircuitCount)
|
||||
*pCircuitCount = 0;
|
||||
return;
|
||||
}
|
||||
LOCK_CLIENTQ;
|
||||
{
|
||||
int circuitCount = ellCount ( &clientQ );
|
||||
|
Reference in New Issue
Block a user