Freeeaky/fiber-job-system

Error while waiting for counter when not using manager main callback

MohammadMDSA opened this issue · 1 comments

Hi!
I am using the project in my game engine. The scopes of my main loop and job system manager are completely different so I can't put any function in the Manager::Run() method as a callback. The problem is when there is no main callback for the manager, the CurrentFiberIndex property of the main thread tls wouldn't initialize, so when calling Manager::WaitForCounter(), inside the function, an invalid value gets passed as tls->CurrentFiberIndex (65535) and later on I get an exception for accessing fiber index 65535. It is very easy to reproduce: You just have to provide no main function for the Run function and try to wait for a counter. Please HELP!!!!

Hi, I highly recommend using the main function. There is no downside to wrapping your entire code within this function.