#include <stddef.h>
#include <stdlib.h>
#include "cantProceed.h"
#include "dbDefs.h"
#include "epicsEvent.h"
#include "epicsExit.h"
#include "epicsStdioRedirect.h"
#include "epicsThread.h"
#include "epicsMutex.h"
#include "valgrind/valgrind.h"
#include "errlog.h"
#include "ellLib.h"
#include "errMdef.h"
#include "taskwd.h"
Go to the source code of this file.
Enumerator |
---|
twdctlInit |
|
twdctlRun |
|
twdctlDisable |
|
twdctlExit |
|
Definition at line 72 of file taskwd.c.
void taskwdAnyInsert |
( |
void * |
key, |
|
|
TASKWDANYFUNC |
callback, |
|
|
void * |
usr |
|
) |
| |
Definition at line 305 of file taskwd.c.
314 pa = &allocNode()->
a;
319 pm = &allocNode()->
m;
320 pm->
funcs = &anyFuncs;
324 ellAdd(&mList, (
void *)pm);
void epicsStdCall epicsMutexUnlock(epicsMutexId pmutexNode)
Release the semaphore.
const taskwdMonitor * funcs
void ellAdd(ELLLIST *pList, ELLNODE *pNode)
Adds a node to the end of a list.
#define epicsMutexMustLock(ID)
Claim a semaphore (see epicsMutexLock()).
void taskwdAnyRemove |
( |
void * |
key | ) |
|
Definition at line 328 of file taskwd.c.
338 if (pm->
funcs == &anyFuncs) {
352 errlogPrintf(
"taskwdAnyRemove: Unregistered key %p\n", key);
void epicsStdCall epicsMutexUnlock(epicsMutexId pmutexNode)
Release the semaphore.
const taskwdMonitor * funcs
#define ellNext(PNODE)
Find the next node in list.
int errlogPrintf(const char *pFormat,...)
#define epicsMutexMustLock(ID)
Claim a semaphore (see epicsMutexLock()).
void ellDelete(ELLLIST *pList, ELLNODE *pNode)
Deletes a node from a list.
#define ellFirst(PLIST)
Find the first node in list.
Definition at line 167 of file taskwd.c.
#define EPICS_THREAD_ONCE_INIT
LIBCOM_API void epicsStdCall epicsThreadOnce(epicsThreadOnceId *id, EPICSTHREADFUNC, void *arg)
Definition at line 176 of file taskwd.c.
185 pt = &allocNode()->
t;
202 ellAdd(&tList, (
void *)pt);
void(* insert)(void *usr, epicsThreadId tid)
void epicsStdCall epicsMutexUnlock(epicsMutexId pmutexNode)
Release the semaphore.
const taskwdMonitor * funcs
void ellAdd(ELLLIST *pList, ELLNODE *pNode)
Adds a node to the end of a list.
#define ellNext(PNODE)
Find the next node in list.
#define epicsMutexMustLock(ID)
Claim a semaphore (see epicsMutexLock()).
#define ellFirst(PLIST)
Find the first node in list.
LIBCOM_API epicsThreadId epicsStdCall epicsThreadGetIdSelf(void)
void taskwdMonitorAdd |
( |
const taskwdMonitor * |
funcs, |
|
|
void * |
usr |
|
) |
| |
Definition at line 248 of file taskwd.c.
252 if (funcs ==
NULL)
return;
256 pm = &allocNode()->
m;
261 ellAdd(&mList, (
void *)pm);
void epicsStdCall epicsMutexUnlock(epicsMutexId pmutexNode)
Release the semaphore.
const taskwdMonitor * funcs
void ellAdd(ELLLIST *pList, ELLNODE *pNode)
Adds a node to the end of a list.
#define epicsMutexMustLock(ID)
Claim a semaphore (see epicsMutexLock()).
void taskwdMonitorDel |
( |
const taskwdMonitor * |
funcs, |
|
|
void * |
usr |
|
) |
| |
Definition at line 265 of file taskwd.c.
269 if (funcs ==
NULL)
return;
void epicsStdCall epicsMutexUnlock(epicsMutexId pmutexNode)
Release the semaphore.
const taskwdMonitor * funcs
#define ellNext(PNODE)
Find the next node in list.
int errlogPrintf(const char *pFormat,...)
#define epicsMutexMustLock(ID)
Claim a semaphore (see epicsMutexLock()).
void ellDelete(ELLLIST *pList, ELLNODE *pNode)
Deletes a node from a list.
#define ellFirst(PLIST)
Find the first node in list.
Definition at line 206 of file taskwd.c.
220 if (tid == pt->
tid) {
241 errlogPrintf(
"taskwdRemove: Thread %s (%p) not registered!\n",
void epicsStdCall epicsMutexUnlock(epicsMutexId pmutexNode)
Release the semaphore.
const taskwdMonitor * funcs
#define ellNext(PNODE)
Find the next node in list.
void(* remove)(void *usr, epicsThreadId tid)
LIBCOM_API void epicsStdCall epicsThreadGetName(epicsThreadId id, char *name, size_t size)
int errlogPrintf(const char *pFormat,...)
#define epicsMutexMustLock(ID)
Claim a semaphore (see epicsMutexLock()).
void ellDelete(ELLLIST *pList, ELLNODE *pNode)
Deletes a node from a list.
#define ellFirst(PLIST)
Find the first node in list.
LIBCOM_API epicsThreadId epicsStdCall epicsThreadGetIdSelf(void)
LIBCOM_API void taskwdShow |
( |
int |
level | ) |
|
Definition at line 358 of file taskwd.c.
361 int mCount, fCount, tCount;
374 printf(
"%d monitors, %d threads registered, %d free nodes\n",
375 mCount, tCount, fCount);
377 printf(
"%16.16s %9s %12s %12s %12s\n",
378 "THREAD NAME",
"STATE",
"EPICS TID",
"epicsCallback",
"USR ARG");
382 printf(
"%16.16s %9s %12p %12p %12p\n",
383 tName, pt->
suspended ?
"Suspended" :
"Ok ",
#define ellCount(PLIST)
Report the number of nodes in a list.
void epicsStdCall epicsMutexUnlock(epicsMutexId pmutexNode)
Release the semaphore.
#define ellNext(PNODE)
Find the next node in list.
LIBCOM_API void epicsStdCall epicsThreadGetName(epicsThreadId id, char *name, size_t size)
#define epicsMutexMustLock(ID)
Claim a semaphore (see epicsMutexLock()).
#define ellFirst(PLIST)
Find the first node in list.