0

I have this global variable. void * userInterface; and this line in main.cpp _beginthread( ReceiveThread, 0, NULL); and

ReceiveThread

void ReceiveThread( void* Param )
{
	...........
	QString str;
	rovkonInterface *w=((rovkonInterface *)userInterface);
	w->ui.systemStatusText->insertPlainText("abc");
        ........

and I get runtime error:
ASSERT:"qApp && qApp->thread()==currentQThread" in file ....

and I tested same code snippet in normal functions and it worked properly. Also I used other global variable also without a problem, but when insert the line: w->ui.systemStatusText->insertPlainText("abc"); I am getting runtime error.

What can be the problem?
Thanks.

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by Salem
0

Is the global variable shared between threads?

The assert seems to be checking that some property is equal to the current thread.
The assert is triggered when this is NO LONGER TRUE

My deduction is that you have several threads munging the same data, and sooner or later, boom.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.