From c9d466380dccec10b97815b91c3e9fb472f63475 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Tue, 27 Jun 2000 23:09:16 +0000 Subject: [PATCH] specify that the client's timer queue is thread managed --- src/ca/cac.cpp | 46 +++++++++++++++++++++------------------------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/src/ca/cac.cpp b/src/ca/cac.cpp index fa6c9efda..da77d3e99 100644 --- a/src/ca/cac.cpp +++ b/src/ca/cac.cpp @@ -73,7 +73,7 @@ cac::cac ( bool enablePreemptiveCallbackIn ) : } } - this->pTimerQueue = new osiTimerQueue ( abovePriority ); + this->pTimerQueue = new osiTimerQueue ( osiTimerQueue::mtsCreateManagerThread, abovePriority ); if ( ! this->pTimerQueue ) { throwWithLocation ( caErrorCode (ECA_ALLOCMEM) ); } @@ -120,15 +120,6 @@ cac::cac ( bool enablePreemptiveCallbackIn ) : strncpy (this->ca_pUserName, tmp, len); } - /* record the host name */ - this->ca_pHostName = localHostName(); - if ( ! this->ca_pHostName ) { - semBinaryDestroy (this->ca_io_done_sem); - semBinaryDestroy (this->ca_blockSem); - free (this->ca_pUserName); - throwWithLocation ( caErrorCode (ECA_ALLOCMEM) ); - } - this->programBeginTime = osiTime::getCurrent (); status = envGetDoubleConfigParam (&EPICS_CA_CONN_TMO, &this->ca_connectTMO); @@ -176,7 +167,7 @@ cac::~cac () // this->defaultMutex.lock (); tsDLIterBD iter ( this->localChanList.first () ); - while ( iter != tsDLIterBD ::eol () ) { + while ( iter.valid () ) { tsDLIterBD pnext = iter.itemAfter (); iter->destroy (); iter = pnext; @@ -194,13 +185,13 @@ cac::~cac () // this->iiuListMutex.lock (); tsDLIterBD piiu ( this->iiuListIdle.first () ); - while ( piiu != piiu.eol () ) { + while ( piiu.valid () ) { tsDLIterBD pnext = piiu.itemAfter (); piiu->suicide (); piiu = pnext; } piiu = this->iiuListRecvPending.first (); - while ( piiu != piiu.eol () ) { + while ( piiu.valid () ) { tsDLIterBD pnext = piiu.itemAfter (); piiu->suicide (); piiu = pnext; @@ -241,13 +232,6 @@ cac::~cac () free ( this->ca_pUserName ); } - /* - * free host name string - */ - if ( this->ca_pHostName ) { - free ( this->ca_pHostName ); - } - this->beaconTable.destroyAllEntries (); semBinaryDestroy ( this->ca_io_done_sem ); @@ -323,12 +307,12 @@ void cac::flush () */ this->iiuListMutex.lock (); tsDLIterBD piiu ( this->iiuListIdle.first () ); - while ( piiu != tsDLIterBD::eol () ) { + while ( piiu.valid () ) { piiu->flush (); piiu++; } piiu = this->iiuListRecvPending.first (); - while ( piiu != tsDLIterBD::eol () ) { + while ( piiu.valid () ) { piiu->flush (); piiu++; } @@ -384,13 +368,13 @@ void cac::show (unsigned level) const this->iiuListMutex.lock (); tsDLIterConstBD piiu ( this->iiuListIdle.first () ); - while ( piiu != piiu.eol () ) { + while ( piiu.valid () ) { piiu->show (level); piiu++; } piiu = this->iiuListRecvPending.first (); - while ( piiu != piiu.eol () ) { + while ( piiu.valid () ) { piiu->show (level); piiu++; } @@ -582,7 +566,7 @@ void cac::beaconNotify ( const inetAddrID &addr ) * to zero */ tsDLIterBD iter ( this->pudpiiu->chidList.first () ); - while ( iter != tsDLIterBD::eol () ) { + while ( iter.valid () ) { iter->retry = 0u; iter++; } @@ -1015,4 +999,16 @@ void cac::repeaterSubscribeConfirmNotify () if ( this->pRepeaterSubscribeTmr ) { this->pRepeaterSubscribeTmr->confirmNotify (); } +} + +void cac::replaceErrLogHandler ( caPrintfFunc *ca_printf_func ) +{ + this->defaultMutex.lock (); + if ( ca_printf_func ) { + this->ca_printf_func = ca_printf_func; + } + else { + this->ca_printf_func = epicsVprintf; + } + this->defaultMutex.unlock (); } \ No newline at end of file