From c69536fc8e2a26ccd28f8ca20ed87eafbbb136b3 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Tue, 28 Oct 2003 16:05:49 +0000 Subject: [PATCH] return an error condition if they try to start a preemptive callback enabled context when the thread already has a single threaded context. --- src/ca/access.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ca/access.cpp b/src/ca/access.cpp index 7e263517e..0f1816210 100644 --- a/src/ca/access.cpp +++ b/src/ca/access.cpp @@ -194,6 +194,10 @@ int epicsShareAPI ca_context_create ( pcac = ( ca_client_context * ) epicsThreadPrivateGet ( caClientContextId ); if ( pcac ) { + if ( premptiveCallbackSelect == ca_enable_preemptive_callback && + ! pcac->preemptiveCallbakIsEnabled() ) { + return ECA_NOTTHREADED; + } return ECA_NORMAL; }