![]() |
This is Unofficial EPICS BASE Doxygen Site
|
#include <stddef.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <vxWorks.h>
#include <taskLib.h>
#include <taskVarLib.h>
#include <sysLib.h>
#include "errlog.h"
#include "ellLib.h"
#include "epicsThread.h"
#include "cantProceed.h"
#include "epicsAssert.h"
#include "vxLib.h"
#include "epicsExit.h"
Go to the source code of this file.
Classes | |
struct | epicsThreadOSD |
Macros | |
#define | _VSB_CONFIG_FILE <../lib/h/config/vsbConfig.h> |
#define | ALLOT_JOIN(tid) |
#define | ARCH_STACK_FACTOR 1 |
#define | ID_LIST_CHUNK 512 |
#define | THREAD_SEM_FLAGS (SEM_DELETE_SAFE|SEM_INVERSION_SAFE|SEM_Q_PRIORITY) |
#define | EPICS_THREAD_ONCE_DONE &threadOnceComplete |
#define | PREPARE_JOIN(tid, joinable) |
#define | AWAIT_JOIN(tid) |
#define | TASK_FLAGS (VX_FP_TASK) |
Variables | |
int | taskIdListSize = 0 |
#define _VSB_CONFIG_FILE <../lib/h/config/vsbConfig.h> |
Definition at line 15 of file osdThread.c.
#define ALLOT_JOIN | ( | tid | ) |
Definition at line 49 of file osdThread.c.
#define ARCH_STACK_FACTOR 1 |
Definition at line 56 of file osdThread.c.
#define AWAIT_JOIN | ( | tid | ) |
Definition at line 226 of file osdThread.c.
#define EPICS_THREAD_ONCE_DONE &threadOnceComplete |
#define ID_LIST_CHUNK 512 |
Definition at line 66 of file osdThread.c.
#define PREPARE_JOIN | ( | tid, | |
joinable | |||
) |
Definition at line 225 of file osdThread.c.
#define TASK_FLAGS (VX_FP_TASK) |
Definition at line 251 of file osdThread.c.
#define THREAD_SEM_FLAGS (SEM_DELETE_SAFE|SEM_INVERSION_SAFE|SEM_Q_PRIORITY) |
Definition at line 108 of file osdThread.c.
void atRebootRegister | ( | void | ) |
Definition at line 22 of file atReboot.cpp.
epicsThreadId epicsThreadCreateOpt | ( | const char * | name, |
EPICSTHREADFUNC | funptr, | ||
void * | parm, | ||
const epicsThreadOpts * | opts | ||
) |
Allocate and start a new OS thread.
name | A name describing this thread. Appears in various log and error message. |
funptr | The thread main function. |
parm | Passed to thread main function. |
opts | Modifiers for the new thread, or NULL to use target specific defaults. |
Definition at line 253 of file osdThread.c.
void epicsThreadEntry | ( | EPICSTHREADFUNC | func, |
void * | parm | ||
) |
Definition at line 230 of file osdThread.c.
void epicsThreadExitMain | ( | void | ) |
If the main routine is done but wants to let other threads run it can call this routine. This should be the last call in main, except the final return. On most systems epicsThreadExitMain never returns.This must only be called by the main thread.
Definition at line 353 of file osdThread.c.
LIBCOM_API int epicsThreadGetCPUs | ( | void | ) |
Return a value approximating the number of threads which this target can run in parallel. This value is advisory.
Definition at line 574 of file osdThread.c.
epicsThreadId epicsThreadGetId | ( | const char * | name | ) |
Attempt to find the first instance of a thread by name.
Definition at line 442 of file osdThread.c.
epicsThreadId epicsThreadGetIdSelf | ( | void | ) |
Find an epicsThreadId associated with the current thread. For non-EPICS threads, a new epicsThreadId may be allocated.
Definition at line 437 of file osdThread.c.
void epicsThreadGetName | ( | epicsThreadId | id, |
char * | name, | ||
size_t | size | ||
) |
Copy out the thread name into the provided buffer.
Guaranteed to be null terminated. size is number of bytes in buffer to hold name (including terminator). Failure results in an empty string stored in name.
Definition at line 453 of file osdThread.c.
const char* epicsThreadGetNameSelf | ( | void | ) |
Return the name of the current thread.
This is either a copy of the string passed to epicsThread*Create*(), or an arbitrary unique string for non-EPICS threads.
Definition at line 448 of file osdThread.c.
unsigned int epicsThreadGetPriority | ( | epicsThreadId | id | ) |
unsigned int epicsThreadGetPrioritySelf | ( | void | ) |
Return thread OSI priority
Definition at line 369 of file osdThread.c.
unsigned int epicsThreadGetStackSize | ( | epicsThreadStackSizeClass | size | ) |
Get a stack size value that can be given to epicsThreadCreate().
size | one of the values epicsThreadStackSmall, epicsThreadStackMedium or epicsThreadStackBig. |
Definition at line 137 of file osdThread.c.
epicsThreadBooleanStatus epicsThreadHighestPriorityLevelBelow | ( | unsigned int | priority, |
unsigned * | pPriorityJustBelow | ||
) |
Lookup the next usage OSI priority such that priority > *pPriorityJustBelow if this is possible with the current target configuration and privlages.
Definition at line 385 of file osdThread.c.
int epicsThreadIsEqual | ( | epicsThreadId | id1, |
epicsThreadId | id2 | ||
) |
Test if two thread IDs actually refer to the same OS thread
Definition at line 409 of file osdThread.c.
int epicsThreadIsSuspended | ( | epicsThreadId | id | ) |
How and why a thread can be suspended is implementation dependent. A thread calling epicsThreadSuspendSelf() should result in this routine returning true for that thread, but a thread may also be suspended for other reasons.
Definition at line 414 of file osdThread.c.
epicsThreadBooleanStatus epicsThreadLowestPriorityLevelAbove | ( | unsigned int | priority, |
unsigned * | pPriorityJustAbove | ||
) |
Lookup the next usage OSI priority such that priority < *pPriorityJustBelow if this is possible with the current target configuration and privlages.
Definition at line 396 of file osdThread.c.
LIBCOM_API void epicsThreadMap | ( | EPICS_THREAD_HOOK_ROUTINE | func | ) |
Call func once for every known thread.
Definition at line 460 of file osdThread.c.
void epicsThreadMustJoin | ( | epicsThreadId | id | ) |
Wait for a joinable thread to exit (return from its main function)
Definition at line 291 of file osdThread.c.
void epicsThreadOnce | ( | epicsThreadOnceId * | id, |
void(*)(void *) | func, | ||
void * | arg | ||
) |
Definition at line 159 of file osdThread.c.
epicsThreadPrivateId epicsThreadPrivateCreate | ( | void | ) |
Allocate a new thread local variable. This variable will initially hold NULL for each thread.
Definition at line 509 of file osdThread.c.
void epicsThreadPrivateDelete | ( | epicsThreadPrivateId | id | ) |
Free a thread local variable
Definition at line 522 of file osdThread.c.
void* epicsThreadPrivateGet | ( | epicsThreadPrivateId | ) |
void epicsThreadPrivateSet | ( | epicsThreadPrivateId | , |
void * | |||
) |
Update thread local variable
Definition at line 532 of file osdThread.c.
void epicsThreadRealtimeLock | ( | void | ) |
When real-time scheduling is active, attempt any post-init operations that preserve real-time performance. For POSIX targets this locks the process into RAM, preventing swap-related VM faults.
Definition at line 134 of file osdThread.c.
void epicsThreadResume | ( | epicsThreadId | id | ) |
void epicsThreadSetPriority | ( | epicsThreadId | id, |
unsigned int | priority | ||
) |
void epicsThreadShow | ( | epicsThreadId | id, |
unsigned int | level | ||
) |
void epicsThreadShowAll | ( | unsigned int | level | ) |
Print to stdout information about all running EPICS threads.
level | 0 prints minimal output. Higher values print more details. |
Definition at line 483 of file osdThread.c.
void epicsThreadSleep | ( | double | seconds | ) |
Block the calling thread for at least the specified time.
seconds | Time to wait in seconds. Values <=0 blocks for the shortest possible time. |
Definition at line 420 of file osdThread.c.
double epicsThreadSleepQuantum | ( | void | ) |
Query a value approximating the OS timer/scheduler resolution.
Definition at line 568 of file osdThread.c.
void epicsThreadSuspendSelf | ( | void | ) |
LIBCOM_API void osdThreadHooksRun | ( | epicsThreadId | id | ) |
Definition at line 105 of file osdThreadHooks.c.
int taskIdListSize = 0 |
Definition at line 68 of file osdThread.c.