GseosBlocks.TThreadSafeBlock
Previous  Top  Next

TThreadSafeBlock(oBlock)

The TThreadSafeBlock constructor creates a new thread safe copy of a GSEOS block. You have to create one instance per thread, per block you want to generate from that thread. Block access is identical to the regular block, you can read and write items and send the block with SendBlock(). Write access to the underlying GSEOS block is automatically synchronized.

ParameterDescription     
oBlockThe block object you want to create a thread safe block for. All block objects can be accessed by name with the GseosBlocks.Blocks[] dictionary.      

Returns
The thread safe block instance.

Comments
You can't install Decoders or Monitors on a thread safe block, use the original block to do this.

Exceptions
TBDMBlockErrorThe passed in object is not a TBDMBlock object.     

Example
The following example creates a thread safe instance of the TLM block. You can use the oTLMSafe block to access from a new thread of execution. If you have multiple threads accessing the TLM block you will have to create an instance for each thread.

import GseosBlocks

oTLM     = GseosBlocks.Blocks['TLM']
oTLMSafe = GseosBlocks.TThreadSafeBlock(oTLM)