EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  <20042005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  <20042005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: ca_repeater bug
From: Till Straumann <[email protected]>
To: [email protected]
Date: Wed, 15 Sep 2004 18:33:48 -0500
Folks.

the caRepeater thread calls 'exit()' which is not really
what you want to do from the ca server (I guess)

-- T.
*** base-3.14.6/src/ca/repeater.cpp.orig	Mon Feb  2 22:32:00 2004
--- base-3.14.6/src/ca/repeater.cpp	Wed Sep 15 18:31:58 2004
***************
*** 484,490 ****
  /*
   *  ca_repeater ()
   */
! void ca_repeater () 
  {
      tsFreeList < repeaterClient, 0x20 > freeList;
      int size;
--- 484,490 ----
  /*
   *  ca_repeater ()
   */
! static int ca_repeater_func () 
  {
      tsFreeList < repeaterClient, 0x20 > freeList;
      int size;
***************
*** 506,512 ****
          if ( SOCKERRNO == SOCK_EADDRINUSE ) {
              osiSockRelease ();
              debugPrintf ( ( "CA Repeater: exiting because a repeater is already running\n" ) );
!             exit (0);
          }
          char sockErrBuf[64];
          epicsSocketConvertErrnoToString ( 
--- 506,512 ----
          if ( SOCKERRNO == SOCK_EADDRINUSE ) {
              osiSockRelease ();
              debugPrintf ( ( "CA Repeater: exiting because a repeater is already running\n" ) );
!             return (0);
          }
          char sockErrBuf[64];
          epicsSocketConvertErrnoToString ( 
***************
*** 515,521 ****
              __FILE__, sockErrBuf );
          osiSockRelease ();
          delete [] pBuf;
!         exit(0);
      }
  
      debugPrintf ( ( "CA Repeater: Attached and initialized\n" ) );
--- 515,521 ----
              __FILE__, sockErrBuf );
          osiSockRelease ();
          delete [] pBuf;
!         return(0);
      }
  
      debugPrintf ( ( "CA Repeater: Attached and initialized\n" ) );
***************
*** 574,579 ****
--- 574,586 ----
  
          fanOut ( from, pMsg, size, freeList ); 
      }
+     return -1;
+ }
+ 
+ void ca_repeater(void)
+ {
+ 	if ( 0 == ca_repeater_func() )
+ 		exit(0);
  }
  
  /*
***************
*** 582,588 ****
  extern "C" void caRepeaterThread ( void * /* pDummy */ )
  {
      taskwdInsert ( epicsThreadGetIdSelf(), NULL, NULL );
!     ca_repeater ();
  }
  
  
--- 589,596 ----
  extern "C" void caRepeaterThread ( void * /* pDummy */ )
  {
      taskwdInsert ( epicsThreadGetIdSelf(), NULL, NULL );
!     if ( 0 == ca_repeater_func () )
!         taskwdRemove( epicsThreadGetIdSelf() );
  }
  
  

Replies:
Re: ca_repeater bug (was Bugs in 3.14.5) Kate Feng
RE: ca_repeater bug (probably observable only on RTEMS) Jeff Hill

Navigate by Date:
Prev: Warm reboot Dalesio, Leo
Next: RE: compiler base using C++ Builder 6[Scanned] Ralph Lange
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  <20042005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Warm reboot Dalesio, Leo
Next: Re: ca_repeater bug (was Bugs in 3.14.5) Kate Feng
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  <20042005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Aug 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·