Hi,
I try to do simple client with couple thread.
============================
static void vFThreadFunction(){
printf("Thread start\n");
struct ca_client_context * pSca_client_context;
pSca_client_context = ca_current_context();//*************
SECOND PLACE
if( pSca_client_context == NULL){
printf("No CA context.\n");
return;
}
}
main(){
printf( "Initialize CA\n");
iStatus = ca_context_create( ca_enable_preemptive_callback);
if( iStatus != ECA_NORMAL) printf( "%s\n", ca_message( iStatus)
);
struct ca_client_context * pSca_client_context;
pSca_client_context = ca_current_context();//************* FIRST
PLACE
aServerThreadId = epicsThreadCreate( "Auxualury thread",
epicsThreadPriorityMedium,
epicsThreadStackMedium, ( EPICSTHREADFUNC)
vFThreadFunction, NULL);
if( aServerThreadId == 0) printf( "Thread couldn't start.\n");
epicsThreadSleep( 10);
.....
====================================
In first place pSca_client_context != NULL.
In second place pSca_client_context = NULL.
So should I prepare pointer (pSca_client_context) in basic thread
and then auxiliary thread uses it?
Second question.
I open channel to PV in basic thread and have chid chidChannelToPV. I
can use it in auxiliary thread too. Am I right?
Thanks, Andrei.
- Replies:
- RE: CA client: Where should ca_current_context() be used? Jeff Hill
- Navigate by Date:
- Prev:
Re: ezcaIDL ELF class error Steven Hartman
- Next:
RE: CA client: Where should ca_current_context() be used? Jeff Hill
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
<2004>
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: ezcaIDL ELF class error Ben-chin K. Cha
- Next:
RE: CA client: Where should ca_current_context() be used? Jeff Hill
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
<2004>
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|