File MIES_ThreadsafeDataSharing.ipf

Helper functions for accessing global objects from all threads.

Functions

static variable TSDS_Create(string name, variable var)

Creates/Overwrites a threadstorage and puts a numerical value in.

variable TSDS_ReadVar(string name, variable defValue = defaultValue, variable create = defaultValue)

Reads a numerical value from a threadstorage.

Parameters:
  • name – name of threadstorage

  • defValue – [optional: default NaN] default value used when storage is created, create flag must be set

  • create – [optional: default 0] when set the threadstorage is created if it did not exist or had an incompatible format, defValue must be given

static wave TSDS_Read(string name)

Reads a single wave ref wave from a named threadstorage.

variable TSDS_WriteVar(string name, variable var)

Writes a numerical value to a threadstorage, if the threadstorage does not exist it is automatically created.

Parameters:
  • name – name of threadstorage

  • var – numerical value that should be written

Returns:

0 if write was successful, 1 if write was not successful