diff --git a/src/ca/oldCAC.cpp b/src/ca/oldCAC.cpp index 46976b2f4..b9c6fa17c 100644 --- a/src/ca/oldCAC.cpp +++ b/src/ca/oldCAC.cpp @@ -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(this) ); - SEVCHK ( status, "error in virtual attach to client context" ); + assert ( ! epicsThreadPrivateGet ( caClientContextId ) ); + epicsThreadPrivateSet ( caClientContextId, this ); }