On 21/11/2017 at 09:38, xxxxxxxx wrote:
User Information:
Cinema 4D Version:
Platform:
Language(s) : C++ ;
---------
Hello I'm currently doing some stuff with thread, and I would like to break on escape key so I do (and it's work pretty well)
Bool PolyThread::TestDBreak(void)
{
BaseThread* const escThread = GeGetEscTestThread();
if (!escThread)
return false;
return (escThread->TestBreak());
}
But I'm asking myself, if it's safe to get the return thread of GeGetEscTestThread() while the init of my thread and then just checking the escThread->TestBreak() in my TestDBreak method?
Which would avoid variable init within a pretty intensive loop (since I call TestDBreak in this loop and I would ideally avoid any variable init from it for performance reason.)
Thanks in advance !