This is Unofficial EPICS BASE Doxygen Site
osdThreadExtra.c
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2002 The University of Chicago, 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 * EPICS BASE is distributed subject to a Software License Agreement found
7 * in file LICENSE that is included with this distribution.
8 \*************************************************************************/
9 
10 /* Author: Marty Kraimer Date: 18JAN2000 */
11 
12 /* This is part of the posix implementation of epicsThread */
13 
14 #include "epicsStdio.h"
15 #include "ellLib.h"
16 #include "epicsEvent.h"
17 #include "epicsThread.h"
18 
21 
22 void epicsThreadShowInfo(epicsThreadOSD *pthreadInfo, unsigned int level)
23 {
24  if(!pthreadInfo) {
25  fprintf(epicsGetStdout()," NAME EPICS ID "
26  "PTHREAD ID OSIPRI OSSPRI STATE\n");
27  } else {
28  struct sched_param param;
29  int policy;
30  int priority = 0;
31 
32  if(pthreadInfo->tid) {
33  int status;
34  status = pthread_getschedparam(pthreadInfo->tid,&policy,&param);
35  if(!status) priority = param.sched_priority;
36  }
37  fprintf(epicsGetStdout(),"%16.16s %14p %12lu %3d%8d %8.8s\n",
38  pthreadInfo->name,(void *)
39  pthreadInfo,(unsigned long)pthreadInfo->tid,
40  pthreadInfo->osiPriority,priority,
41  pthreadInfo->isSuspended?"SUSPEND":"OK");
42  }
43 }
44 
pthread_t tid
Definition: osdThread.h:26
unsigned int osiPriority
Definition: osdThread.h:38
pvd::Status status
EPICS_THREAD_HOOK_ROUTINE epicsThreadHookMain
void(* EPICS_THREAD_HOOK_ROUTINE)(epicsThreadId id)
Definition: epicsThread.h:302
A doubly-linked list library.
FILE *epicsStdCall epicsGetStdout(void)
Definition: epicsStdio.c:47
APIs for the epicsEvent binary semaphore.
EPICS_THREAD_HOOK_ROUTINE epicsThreadHookDefault
char name[1]
Definition: osdThread.h:40
C++ and C descriptions for a thread.
void epicsThreadShowInfo(epicsThreadId pthreadInfo, unsigned int level)