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 2025 | 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 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: Proglem doing CA calls after catching a signal |
From: | Eric Norum <[email protected]> |
To: | Robert Soliday <[email protected]> |
Cc: | tech-talk <[email protected]> |
Date: | Mon, 26 Jul 2004 14:29:31 -0500 |
> int sigint=0; . . .
/* wrapper for ca_pend_event that allows breaking out early if the flag is set from a signal handler. Unlike ca_pend_event, a timeout of zero will not be converted to infinity. */ long oag_ca_pend_event(double timeout, int *flag) { long status=ECA_NORMAL;
if (timeout <= 0) ca_poll(); while (timeout > 0) { if (*flag) return(status); if (timeout > 1) { status = ca_pend_event(1); timeout -= 1; } else { status = ca_pend_event(timeout); timeout = 0; } }
return(status); }
volatile int sigint = 0; . . long oag_ca_pend_event(double timeout, volatile int *flag) { . .
-- Eric Norum [email protected] Advanced Photon Source Phone: (630) 252-4793 Argonne National Laboratory