From 42b8dcc3bfc939d658801ea8b9bfe5006b8a703b Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Mon, 15 Oct 2001 21:46:01 +0000 Subject: [PATCH] allow any CA system thread to attach to a ca context --- src/ca/oldCAC.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 ); }