File MIES_ThreadsafeUtilities.ipf¶
TS Helper functions for threadsafe code and main/worker function interactions.
Functions
-
variable TS_GetNewestFromThreadQueue(variable tgID, string varName, variable timeout_default = defaultValue, variable timeout_tries = defaultValue)¶
Return the newest variable named
varNamefrom the thread queue.Return
NaNif the thread is not running anymore.Throws away anything else in the datafolder from the thread queue.
-
wave TS_GetNewestFromThreadQueueMult(variable tgID, WaveText varNames, variable timeout_default = defaultValue, variable timeout_tries = defaultValue)¶
Return the newest variables from the thread queue.
The function returns if it received at least one variable from the thread queue. Return an invalid wave reference if the thread is not running anymore.
Throws away anything else in the datafolder from the thread queue.
-
variable TS_ThreadGroupGetVariable(variable tgID, string varName)¶
Return the variable named
varNamefrom the thread queue orNaNif there is none.Throws away anything else in the datafolder from the thread queue.
-
variable TS_ThreadGroupPutVariable(variable tgID, string varName, variable varValue)¶
Push a single variable named
varNamewith valuevarValueto the thread queue.
-
variable TS_ThreadGroupPutDFR(variable tgID, dfref dfr)¶
Push a datafolder to the thread queue.
Works on a duplicate of the input DF to remove all references. dfr can be a free DF
-
variable TS_ThreadGroupFinished(variable tgID)¶
Returns 1 if all worker threads have finished.
-
variable TS_StopThreadGroup(variable tgID)¶
Stop the given thread group.
Assumes that the running worker functions finish on getting the
abortvariable sent.