PDA

View Full Version : _beginthread



metdos
24th July 2009, 13:46
I tried to use _beginthread with widgets, I got errors.

So I moved to QThread, but my function which I pass to _beginthread uses global variables, and I don't want to pass these variables as parameters. Is there any function in QT which I can use instead of _beginthread ?

Thanks.

mcosta
24th July 2009, 15:39
but my function which I pass to _beginthread uses global variables, and I don't want to pass these variables as parameters.


Simply use global variables inside the QThread::run() function

franz
25th July 2009, 12:12
If you are using global variables, don't forget to lock them.

wysota
25th July 2009, 12:18
A direct equivalent of _beginthread would be QtConcurrent::run().