EnTerr
9 years agoRoku Guru
How can a function figure out in which thread it's running?
So i was coding in my head last night when going to sleep and a question popped - how would my utility function figure out if it was called from the main thread or the render thread? I figured i'll ask the club here - it's probably something trivial, plus there might be multiple ways?
(If i need to elaborate "how come the developer does not know where he's calling the fn?" - assume the person writing the channel is different from the one that wrote some utility function, one can't rely they'll just call the fn from the "right" location and may want to build a check in)
(If i need to elaborate "how come the developer does not know where he's calling the fn?" - assume the person writing the channel is different from the one that wrote some utility function, one can't rely they'll just call the fn from the "right" location and may want to build a check in)