summaryrefslogtreecommitdiffstats
path: root/runtime/wti.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/wti.h')
-rw-r--r--runtime/wti.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/runtime/wti.h b/runtime/wti.h
index f466a053..51ece4ef 100644
--- a/runtime/wti.h
+++ b/runtime/wti.h
@@ -35,10 +35,11 @@ struct wti_s {
BEGINobjInstance;
pthread_t thrdID; /* thread ID */
int bIsRunning; /* is this thread currently running? (must be int for atomic op!) */
- bool bAlwaysRunning; /* should this thread always run? */
+ sbool bAlwaysRunning; /* should this thread always run? */
wtp_t *pWtp; /* my worker thread pool (important if only the work thread instance is passed! */
batch_t batch; /* pointer to an object array meaningful for current user pointer (e.g. queue pUsr data elemt) */
uchar *pszDbgHdr; /* header string for debug messages */
+ DEF_ATOMIC_HELPER_MUT(mutIsRunning);
};
@@ -50,8 +51,9 @@ rsRetVal wtiWorker(wti_t *pThis);
rsRetVal wtiSetDbgHdr(wti_t *pThis, uchar *pszMsg, size_t lenMsg);
rsRetVal wtiCancelThrd(wti_t *pThis);
rsRetVal wtiSetAlwaysRunning(wti_t *pThis);
-rsRetVal wtiSetState(wti_t *pThis, bool bNew);
-bool wtiGetState(wti_t *pThis);
+rsRetVal wtiSetState(wti_t *pThis, sbool bNew);
+rsRetVal wtiWakeupThrd(wti_t *pThis);
+sbool wtiGetState(wti_t *pThis);
PROTOTYPEObjClassInit(wti);
PROTOTYPEpropSetMeth(wti, pszDbgHdr, uchar*);
PROTOTYPEpropSetMeth(wti, pWtp, wtp_t*);