Lately found that this simple piece of code just crashes on the our latest compiler with -athread=native:
#include <stdio.h>
#include <string>
#include <thread>
int main()
{
printf("before\n");
std::thread::id id = std::this_thread::get_id();
printf("after\n");
}
Which mean, that this is not implemented or didn't handled correctly in adtools repo. Will be it fixed or not, for now pretty hard to say, as there i didn't see any sign that bugs also fixed in adtool's repo: there just keeps collecting lots of bug-reports which didn't taken in account, and all what we report in last year seems didn't fixed.
So, question is, is there possiblity to somehow use my own code inside of this std::this_thread::get_id(), so implementing this will works in all other's code which use it as expected ?
Sebastian says that probabaly i can use there FindTask(NULL), so i tried it like this:
#include <stdio.h>
#include <string>
#include <thread>
int main()
{
printf("before\n");
std::thread::id id = (std::thread::id)IExec->FindTask(NULL);
printf("after\n");
}
So for first it give a error "error: invalid conversion from ‘Task*’ to ‘std::thread::native_handle_type’ {aka ‘int’} [-fpermissive]" , and then when i use -fpermissive it compiles and _maybe_ works (at least it print some value), but compiles with warnings.
Is anyone have any idea how to deal with without errors, and , what is more important for easy porting process, so without needs to doing much changes in the game's code itself ?