Go to the documentation of this file. 1 #ifndef _OME_THREAD_CNTRL_H
2 #define _OME_THREAD_CNTRL_H "$Id: OMEthreadCntrl.h 453 2020-07-23 20:20:44Z geoff $"
11 #ifndef DONT_USE_PTHREADS
76 #ifdef PICK_UP_FROM_NATIVE
93 #ifndef DONT_USE_PTHREADS
94 static void *OMEpthreadPrologue(
void *);
137 int64_t delta = stopTick - startTick;
138 pendingTotal += delta;
141 void noteThreadDead(
const class OMEthread *deadThread);
144 return (pendingTotal);
OME process information implementation.
@ OME_THREAD_SUSPEND
thread is suspended
Definition: OMEthread.h:20
OMEthreadController(OMEthread *t)
Definition: OMEthreadCntrl.h:27
virtual void yieldSlice() override
Yield time slice currently being used by an active thread.
Definition: OMEthreadCntrl.cpp:319
@ OME_THREAD_RUNNING
thread is active
Definition: OMEthread.h:21
virtual void suspendThread() override
Suspend an active thread.
Definition: OMEthreadCntrl.cpp:291
~OMEthreadNative()
Definition: OMEthreadCntrl.cpp:187
NativeMethodFP function
Definition: OMEmethod.h:49
virtual void releaseThread() override
Release a suspended thread.
Definition: OMEthreadCntrl.cpp:285
Statistics record to track amount of time used by an OMEthread.
Definition: OMEthreadCntrl.h:118
virtual void executeSlice()=0
Execute a time slice for an active thread.
virtual void releaseThread() override
Release a suspended thread.
Definition: OMEthreadCntrl.cpp:213
virtual void suspendThread() override
Suspend an active thread.
Definition: OMEthreadCntrl.cpp:226
class OMEthread * threadInfo
Definition: OMEthreadCntrl.h:24
uint32_t invocationMode
Definition: OMEmethod.h:47
#define pthread_cleanup_pop(execute)
Definition: tmp.o.cpp:3105
OMEthreadStates getThreadState() const OME_ALWAYS_INLINE
Definition: OMEthread.h:119
virtual void terminateThread() override
Terminate a thread.
Definition: OMEthreadCntrl.cpp:296
void * data
Definition: OMEmethod.h:50
#define pthread_cleanup_push(func, val)
Definition: tmp.o.cpp:3106
int64_t startTick
Definition: OMEthreadCntrl.h:120
void stopInterval()
Definition: OMEthreadCntrl.h:135
Fundamental ANY type for FARGOS/VISTA Object Management Environment.
Definition: OMEbaseType.h:250
Base class and abstract interface for an object within a FARGOS/VISTA Object Management Environment.
Definition: OMEobject.h:22
virtual void yieldSlice() override
Yield time slice currently being used by an active thread.
Definition: OMEthreadCntrl.cpp:258
class OMEthread * activeThread
Definition: OMEthreadCntrl.h:123
void startInterval() OME_ALWAYS_INLINE
Definition: OMEthreadCntrl.h:129
virtual const char * controllerType() const override
Return label identifying the type of the thread controller.
Definition: OMEthreadCntrl.cpp:402
virtual void executeSlice() override
Execute a time slice for an active thread.
Definition: OMEthreadCntrl.h:110
class OMEoid * oid
Definition: OMEbaseType.h:297
#define LOG_COUT(lvl)
Convenience macro that uses LOG_INTO() to conditionally log a message to standard output.
Definition: logging_api.hpp:3007
#define NONNULL_CLASS_PARAMETERS(...)
Mark a function as never returning a null pointer.
Definition: compiler_hints.h:337
#define OMEgetCPUticks()
Definition: OMEprocInfo.h:80
~OMEthreadNativeOIL2()
Definition: OMEthreadCntrl.cpp:276
OME_CORE_CALL int(* NativeMethodFP)(class OMEthread *)
Typedef of a native method.
Definition: OMEmethod.h:20
OME_FAST_CALL void addTickCount(const int64_t tickCount) const OME_ALWAYS_INLINE
Definition: OMEmethod.h:68
OME_FAST_CALL void addTickCount(const int64_t tickCount) const OME_ALWAYS_INLINE
Add tick counts to per-object statistics.
Definition: OMEobject.h:86
#define OME_INVOKE_OIL2_INTERPRET
Definition: OMEmethod.h:11
virtual void suspendThread()=0
Suspend an active thread.
@ OME_THREAD_KILLED
thread has been killed
Definition: OMEthread.h:22
void noteThreadState(const OMEthreadStates s) OME_ALWAYS_INLINE
Definition: OMEthread.h:117
OMEthreadNativeOIL2(OMEthread *t)
Definition: OMEthreadCntrl.cpp:272
const char srcID[]
Definition: catSym.c:17
int64_t pendingTotal
Definition: OMEthreadCntrl.h:122
OMEthreadNative(OMEthread *t)
Definition: OMEthreadCntrl.cpp:149
pthread_mutex_t threadMutex
Definition: OMEthreadCntrl.h:96
virtual void releaseThread()=0
Release a suspended thread.
OME_FAST_CALL void threadNowTerminated(uint32_t exitStatus, bool dontDelete=false)
Definition: OMEthread.cpp:1051
pthread_cond_t suspendCondition
Definition: OMEthreadCntrl.h:97
void setTickInterval(class OMEtickInterval *interval) OME_ALWAYS_INLINE
Definition: OMEthread.h:115
#define OME_EXPECT_TRUE(expr)
Annotation macro for conditional expression expected to be true.
Definition: compiler_hints.h:541
OMEcallStack * callStack
Definition: OMEthread.h:74
#define NULL
Definition: tmp.o.cpp:327
virtual void terminateThread()=0
Terminate a thread.
virtual void executeSlice() override
Execute a time slice for an active thread.
Definition: OMEthreadCntrl.cpp:324
void noteThreadDead(const class OMEthread *deadThread)
Definition: OMEthreadCntrl.cpp:52
static void * OMEpthreadPrologue(void *)
Definition: OMEthreadCntrl.cpp:73
virtual const char * controllerType() const override
Return label identifying the type of the thread controller.
Definition: OMEthreadCntrl.cpp:200
int64_t stopTick
Definition: OMEthreadCntrl.h:121
Abstract interface for an OME thread controller.
Definition: OMEthreadCntrl.h:22
const char srcID[] OME_USED
Definition: tick_time.cpp:24
Implementation of OME threads for compiled OIL2 source.
Definition: OMEthreadCntrl.h:52
#define OME_CONST_FUNCTION
Mark as an idempotent function that only accesses arguments – no global data.
Definition: compiler_hints.h:390
void addReadOnlyReference()
Definition: OMErefCount.cpp:139
void addIntervalCounts(const OMEinvocationData *method)
Definition: OMEthreadCntrl.cpp:41
class OMEtickInterval * tickInterval
Definition: OMEthread.h:85
#define OME_EXPECT_FALSE(expr)
Annotation macro for conditional expression expected to be false.
Definition: compiler_hints.h:540
#define PTHREAD_SCOPE_SYSTEM
Definition: tmp.o.cpp:447
#define OME_ALWAYS_INLINE
Tell the compiler to alway inline a function, regardless of optimization level.
Definition: compiler_hints.h:364
Record to describe the implementation of the method of an OME class.
Definition: OMEmethod.h:35
int64_t intervalLength() const
Definition: OMEthreadCntrl.h:143
virtual const char * controllerType() const override
Return label identifying the type of the thread controller.
Definition: OMEthreadCntrl.cpp:280
Implementation of OME thread controller for native threads.
Definition: OMEthreadCntrl.h:89
pthread_t threadID
Definition: OMEthreadCntrl.h:98
OME mutex and condition variable implementation.
~OMEthreadInterpretOIL2()
Definition: OMEthreadCntrl.cpp:398
int_fast32_t dropReference()
Definition: OMErefCount.cpp:144
virtual const char * controllerType() const OME_CONST_FUNCTION=0
Return label identifying the type of the thread controller.
Public interface to an OME thread.
Definition: OMEthread.h:60
#define LOG_ENDLINE
Closing clause for text line output using << operators.
Definition: logging_api.hpp:2956
Public interface to an OME Object Identifier.
Definition: OMEoid.h:196
const OME_FAST_CALL OMEtype & getThisObject() const
Definition: OMEthread.h:51
virtual void terminateThread() override
Terminate a thread.
Definition: OMEthreadCntrl.cpp:239
uint32_t exitStatus
Definition: OMEthreadCntrl.h:25
union OMEinvocationData::@30 code
#define OME_INVOKE_OIL2_NATIVE
Definition: OMEmethod.h:12
const class OMEobject * getInstanceInMemory() const
Return object information record.
Definition: OMEoid.h:280
Specialization of OMEthreadNativeOIL2 for OIL2 source compiled to OIL2 Architecture Native Format.
Definition: OMEthreadCntrl.h:70
const OMEinvocationData * methodBody
Definition: OMEthread.h:34
OMEtickInterval(class OMEthread *thread) NONNULL_CLASS_PARAMETERS(2)
Definition: OMEthreadCntrl.cpp:16
virtual void yieldSlice()=0
Yield time slice currently being used by an active thread.
OMEthreadInterpretOIL2(OMEthread *t)
Definition: OMEthreadCntrl.cpp:394
virtual ~OMEthreadController()
Definition: OMEthreadCntrl.h:32
#define LOG_CERR(lvl)
Convenience macro that uses LOG_INTO() to conditionally log a message to standard error.
Definition: logging_api.hpp:3014
int OMEoil2Interpreter(OMEthread *thread, const OMEtype &codeBody)
Entry point for the OIL2 Architecture Neutral Format interpreter.
Definition: copyIntrp.cpp:288
~OMEtickInterval()
Definition: OMEthreadCntrl.cpp:24
void OMEqueueOIL2thread(OMEthread *t)
Definition: OMEexecQueue.cpp:586