Answer the question
In order to leave comments, you need to log in
Why is a variable sometimes taken incorrectly in a thread?
The bottom line is, there is some simulation of the model in which flows are created to simulate the flight of an object
void Simulator::Start(ModuleRls &RLS)
{
for (uint i = 0; i < flyObjVector.size(); i++)
{
StreamFly *obj = new StreamFly(flyObjVector, RLS, i + 1);
obj->start();
}
}
void StreamFly::run()
{
for (int i = 0; i < 50; i++)
{
qDebug() << id << "[" << QThread::currentThreadId() << "]" << RLS->getX();
}
}
1 [ 0x1a88 ] 50
1 [ 0x1a88 ] 50
1 [ 0x1a88 ] 50
1 [ 0x1a88 ] 50
1 [ 0x1a88 ] 50
1 [ 0x1a88 ] 50
1 [ 0x1a88 ] 50
1 [ 0x1a88 ] 50
1 [ 0x1a88 ] 50
1 [ 0x1a88 ] 50
1 [ 0x1a88 ] 50
1 [ 0x1a88 ] 50
6 [ 0x1cf8 ] 2675932
6 [ 0x1cf8 ] 49351064
6 [ 0x1cf8 ] 49351064
6 [ 0x1cf8 ] 49351064
6 [ 0x1cf8 ] 49351064
6 [ 0x1cf8 ] 49351064
6 [ 0x1cf8 ] 49351064
6 [ 0x1cf8 ] 49351064
6 [ 0x1cf8 ] 49351064
6 [ 0x1cf8 ] 49351064
6 [ 0x1cf8 ] 49351064
6 [ 0x1cf8 ] 49351064
6 [ 0x1cf8 ] 49351064
6 [ 0x1cf8 ] 49351064
6 [ 0x1cf8 ] 49351064
6 [ 0x1cf8 ] 49351064
6 [ 0x1cf8 ] 49351064
6 [ 0x1cf8 ] 49351064
6 [ 0x1cf8 ] 49351064
6 [ 0x1cf8 ] 49351064
6 [ 0x1cf8 ] 49351064
6 [ 0x1cf8 ] 49351064
6 [ 0x1cf8 ] 49351064
6 [ 0x1cf8 ] 49351064
6 [ 0x1cf8 ] 49351064
6 [ 0x1cf8 ] 49351064
6 [ 0x1cf8 ] 49351064
6 [ 0x1cf8 ] 49351064
2 [ 0x1c78 ] 50
6 [ 0x1cf8 ] 6900
2 [ 0x1c78 ] 6900
6 [ 0x1cf8 ] 6900
2 [ 0x1c78 ] 6900
2 [ 0x1c78 ] 6900
6 [ 0x1cf8 ] 6900
2 [ 0x1c78 ] 6900
6 [ 0x1cf8 ] 6900
7 [ 0x1d00 ] 6900
4 [ 0x1de8 ] 6900
6 [ 0x1cf8 ] 6900
4 [ 0x1de8 ] 6900
6 [ 0x1cf8 ] 6900
2 [ 0x1c78 ] 6900
4 [ 0x1de8 ] 6900
6 [ 0x1cf8 ] 6900
7 [ 0x1d00 ] 6900
4 [ 0x1de8 ] 6900
8 [ 0x1d0c ] 6900
6 [ 0x1cf8 ] 6900
Answer the question
In order to leave comments, you need to log in
without the getX() code, nothing is clear
This function is probably not thread safe
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question