|
|
Experimental Physics and
| ||||||||||||||
|
|
pthread_mutex_unlock failed: error Not owner fatal error: epicsMutexOsdUnlock I have included a simple program that displays the same problem. If anyone knows the proper way of doing CA calls after catching a signal please let me know. Thanks, --Bob Soliday #include <stdio.h> #include <strings.h> #include <cadef.h> #include <signal.h> void interrupt_handler(int); chid channelID[1]; char names[1][40]; int main(int argc, char **argv)
{
strcpy(names[0], "oag:H1:setCurrentC"); ca_task_initialize();
if (ca_search(names[0], &channelID[0])!=ECA_NORMAL) {
fprintf(stderr, "error: search failed for PV\n");
return(1);
}
if (ca_pend_io(10)!=ECA_NORMAL) {
fprintf(stderr, "error: search failed for PV\n");
return(1);
}
fprintf(stdout, "Found PV\n");
signal(SIGINT, interrupt_handler);
ca_pend_event(10);
ca_task_exit();
fprintf(stdout, "Done\n");
return(0);
}void interrupt_handler(int sig) {
double value;
fprintf(stdout, "Interrupt detected\n");
if (ca_get(DBR_DOUBLE, channelID[0], &value)!=ECA_NORMAL) {
fprintf(stderr, "Error: unable to get value for PV\n");
}
if (ca_pend_io(10)!=ECA_NORMAL) {
fprintf(stderr, "Error: unable to get value for PV\n");
}
fprintf(stdout, "value = %lf\n", value);
}
| ||||||||||||||
| ANJ, 10 Aug 2010 |
·
Home
·
News
·
About
·
Talk
·
Base
·
Modules
·
Extensions
·
· Distributions · Download · Documents · Links · Licensing · |