From 47aeeb2d18443dc7a4661dde6bc50e4286433fbb Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Thu, 7 Sep 2000 01:18:45 +0000 Subject: [PATCH] removed --- src/ca/caConnTest.c | 58 ----------------------------- src/ca/caConnTestMain.c | 36 ------------------ src/ca/cacPrivate.cpp | 81 ----------------------------------------- 3 files changed, 175 deletions(-) delete mode 100644 src/ca/caConnTest.c delete mode 100644 src/ca/caConnTestMain.c delete mode 100644 src/ca/cacPrivate.cpp diff --git a/src/ca/caConnTest.c b/src/ca/caConnTest.c deleted file mode 100644 index a63b8852e..000000000 --- a/src/ca/caConnTest.c +++ /dev/null @@ -1,58 +0,0 @@ - -#include -#include - -#include -#include - -static unsigned channelCount = 0u; -static unsigned connCount = 0u; - -static void connHandler ( struct connection_handler_args args ) -{ - if ( args.op == CA_OP_CONN_UP ) { - connCount++; - if ( connCount == channelCount ) { - printf ( "all channels connected\n" ); - } - } - else if ( args.op == CA_OP_CONN_DOWN ) { - if ( connCount == channelCount ) { - printf ( "channels are disconnected\n" ); - } - connCount--; - } - else { - assert ( 0 ); - } -} - -void caConnTest ( const char *pNameIn, unsigned channelCountIn, double delayIn ) -{ - int status; - unsigned i; - chid *pChans; - - channelCount = channelCountIn; - - pChans = malloc ( channelCount * sizeof ( *pChans ) ); - assert ( pChans ); - - while ( 1 ) { - status = ca_task_initialize(); - SEVCHK ( status, "CA init failed" ); - - for ( i = 0u; i < channelCount; i++ ) { - status = ca_search_and_connect ( pNameIn, &pChans[i], connHandler, 0); - SEVCHK ( status, "CA search problems" ); - } - - status = ca_pend_io ( 60.0 * 10.0 ); - SEVCHK ( status, "channels didnt connect" ); - - ca_pend_event ( delayIn ); - - status = ca_task_exit(); - SEVCHK ( status, "task exit problems" ); - } -} diff --git a/src/ca/caConnTestMain.c b/src/ca/caConnTestMain.c deleted file mode 100644 index abc6641c9..000000000 --- a/src/ca/caConnTestMain.c +++ /dev/null @@ -1,36 +0,0 @@ - -#include -#include - -#include "caDiagnostics.h" - -int main ( int argc, char **argv ) -{ - double delay = 60.0 * 5.0; - unsigned count = 2000; - - if ( argc < 2 || argc > 4 ) { - printf ( "usage: %s < channel name > [ < count > ] [ < delay sec > ]\n", argv[0] ); - return -1; - } - - if ( argc >= 3 ) { - int nConverted = sscanf ( argv[2], "%u", &count ); - if ( nConverted != 1 ) { - printf ( "conversion failed, changing channel count arg \"%s\" to %u\n", - argv[1], count ); - } - } - - if ( argc >= 4 ) { - int nConverted = sscanf ( argv[3], "%lf", &delay ); - if ( nConverted != 1 ) { - printf ( "conversion failed, changing delay arg \"%s\" to %f\n", - argv[2], delay ); - } - } - - caConnTest ( argv[1], count, delay ); - - return 0; -} diff --git a/src/ca/cacPrivate.cpp b/src/ca/cacPrivate.cpp deleted file mode 100644 index 09b9f3d9f..000000000 --- a/src/ca/cacPrivate.cpp +++ /dev/null @@ -1,81 +0,0 @@ - -/* - * $Id$ - * - * - * L O S A L A M O S - * Los Alamos National Laboratory - * Los Alamos, New Mexico 87545 - * - * Copyright, 1986, The Regents of the University of California. - * - * - * Author Jeffrey O. Hill - * johill@lanl.gov - * 505 665 1831 - */ - -#include "iocinf.h" - -cacPrivate::cacPrivate ( cac &cacIn ) : - cacCtx ( cacIn ) -{ -} - -// Destroy all IO blocks attached. -// Care is taken here not to hold the lock while -// sending a subscription delete message (which -// would result in deadlocks) -void cacPrivate::destroyAllIO () -{ - while ( true ) { - unsigned id; - bool done; - - this->cacCtx.defaultMutex.lock (); - { - baseNMIU *pNMIU = this->eventq.first (); - if ( pNMIU ) { - id = pNMIU->getId (); - done = false; - } - else { - id = UINT_MAX; - done = true; - } - } - this->cacCtx.defaultMutex.unlock (); - - if ( done ) { - break; - } - // care is taken to not hold a lock when - // executing this - this->cacCtx.ioDestroy ( id ); - } -} - -// resubscribe for monitors from this channel -void cacPrivate::subscribeAllIO () -{ - this->cacCtx.defaultMutex.lock (); - tsDLIterBD < baseNMIU > iter = this->eventq.first (); - while ( iter.valid () ) { - iter->subscriptionMsg (); - iter++; - } - this->cacCtx.defaultMutex.unlock (); -} - -// cancel IO operations and monitor subscriptions -void cacPrivate::disconnectAllIO ( const char *pHostName ) -{ - this->cacCtx.defaultMutex.lock (); - tsDLIterBD < baseNMIU > iter = this->eventq.first (); - while ( iter.valid () ) { - tsDLIterBD < baseNMIU > next = iter.itemAfter (); - iter->disconnect ( pHostName ); - iter = next; - } - this->cacCtx.defaultMutex.unlock (); -}