EPICS Base  7.0.6.1
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
taskwd.h
1 /*************************************************************************\
2 * Copyright (c) 2008 UChicago Argonne LLC, as Operator of Argonne
3 * National Laboratory.
4 * Copyright (c) 2002 The Regents of the University of California, as
5 * Operator of Los Alamos National Laboratory.
6 * SPDX-License-Identifier: EPICS
7 * EPICS BASE is distributed subject to a Software License Agreement found
8 * in file LICENSE that is included with this distribution.
9 \*************************************************************************/
10 
11 /* General purpose task watchdog */
12 /*
13  * Original Author: Marty Kraimer
14  * Date: 07-18-91
15 */
16 
17 #ifndef INC_taskwd_H
18 #define INC_taskwd_H
19 
20 #include "epicsThread.h"
21 #include "libComAPI.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 
28 /* Initialization, optional */
29 LIBCOM_API void taskwdInit(void);
30 
31 
32 /* For tasks to be monitored */
33 typedef void (*TASKWDFUNC)(void *usr);
34 
35 LIBCOM_API void taskwdInsert(epicsThreadId tid,
36  TASKWDFUNC callback, void *usr);
37 LIBCOM_API void taskwdRemove(epicsThreadId tid);
38 
39 
40 /* Monitoring API */
41 typedef struct {
42  void (*insert)(void *usr, epicsThreadId tid);
43  void (*notify)(void *usr, epicsThreadId tid, int suspended);
44  void (*remove)(void *usr, epicsThreadId tid);
46 
47 LIBCOM_API void taskwdMonitorAdd(const taskwdMonitor *funcs, void *usr);
48 LIBCOM_API void taskwdMonitorDel(const taskwdMonitor *funcs, void *usr);
49 
50 
51 /* Old monitoring API, deprecated */
52 typedef void (*TASKWDANYFUNC)(void *usr, epicsThreadId tid);
53 
54 LIBCOM_API void taskwdAnyInsert(void *key,
55  TASKWDANYFUNC callback, void *usr);
56 LIBCOM_API void taskwdAnyRemove(void *key);
57 
58 
59 /* Report function */
60 LIBCOM_API void taskwdShow(int level);
61 
62 
63 #ifdef __cplusplus
64 }
65 #endif
66 
67 #endif /* INC_taskwd_H */
C++ and C descriptions for a thread.