Call of Duty: Black Ops 3 => Help Desk => Scripting => Topic started by: Doodles_Inc on July 10, 2018, 06:13:42 pm
Title: Calling functions when to use thread
Post by: Doodles_Inc on July 10, 2018, 06:13:42 pm
Another nooby question, I noticed people use thread to call functions, is it needed? What does it do really? What's the difference between and ?
Title: Re: Calling functions when to use thread
Post by: BluntStuffy on July 10, 2018, 07:54:54 pm
When you just call a function, the execution is not going to continue till that function ends. Only when that function is completed, the Original execution-chain will continue.
When you thread a function the execution will continue as well and all code below it will immediately be executed.
So for example, if you call the function AddStuffToVariable() it will print "I have increased":
But if you thread it it will print "I'm still 1" because it immediately executes that code, and the variable will only be increased a second later..:
Title: Re: Calling functions when to use thread
Post by: Doodles_Inc on July 10, 2018, 11:48:30 pm