Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread variables
#2
In example 1, Function cannot use T, because mac creates new thread.
In example 2, Function can use T, but need to declare it there: int- T.

In both cases, it is better to pass the value as an argument, not as a thread variable. In example 2 you can even place val(_command) etc in Function, because it can use _command, because it is a thread variable.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)