allow any CA system thread to attach to a ca context

This commit is contained in:
Jeff Hill
2001-10-15 21:46:01 +00:00
parent 218cf86318
commit 42b8dcc3bf

View File

@@ -20,6 +20,8 @@
#include "oldAccess.h"
extern epicsThreadPrivateId caClientContextId;
oldCAC::oldCAC ( bool enablePreemptiveCallback ) :
clientCtx ( * new cac ( *this, enablePreemptiveCallback ) ),
ca_exception_func ( 0 ), ca_exception_arg ( 0 ),
@@ -199,8 +201,8 @@ void oldCAC::show ( unsigned level ) const
void oldCAC::attachToClientCtx ()
{
int status = ca_attach_context ( reinterpret_cast<struct ca_client_context *>(this) );
SEVCHK ( status, "error in virtual attach to client context" );
assert ( ! epicsThreadPrivateGet ( caClientContextId ) );
epicsThreadPrivateSet ( caClientContextId, this );
}