Author Topic: Scripting: Thread identifier function  (Read 874 times)

0 Members and 1 Guest are viewing this topic.

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Scripting: Thread identifier function
« on: June 04, 2012, 02:11:24 pm »
It would be useful to test what thread is currently being ran. Some sort of identifier. Something as dsimple as CurrentThread(): integer; or something.

My use case:

I am wanting to support some basic threading task to avoid having the server hickup. However, during this process, I write to the player console, referring to a global variable for the color. This global variable may change throughout the process of the thread running, thus changing the color of the player console, an undesired behavior. If I could have a global variable for each thread, this can be avoided.