[Qt-interest] How to stop all threads before quit?
Nguyen Huu Phuoc
nhphuoc at vn.isb.co.jp
Wed Mar 2 07:18:28 CET 2011
Hi Shatokhin
Your program and thread should share a variable flag.
I temporarily call it as isClosed.
Initialize, isClosed = 0.
When your program want to close you change isClosed = 1 and wait until
thread exits.
In thread code, you loop to check if isClosed == 1 call function to thread
exit.
Nguyen Huu Phuoc
ISB VIETNAM Co., Ltd (IVC)
nhphuoc at vn.isb.co.jp
-----Original Message-----
From: qt-interest-bounces+nhphuoc=vn.isb.co.jp at qt.nokia.com
[mailto:qt-interest-bounces+nhphuoc=vn.isb.co.jp at qt.nokia.com] On Behalf Of
Nicholas Shatokhin
Sent: Wednesday, March 02, 2011 9:28 AM
To: qt-interest at qt.nokia.com
Subject: [Qt-interest] How to stop all threads before quit?
I'm creating a qt4 lib for using fingerprint scanner:
https://github.com/NicholasShatokhin/fprint_qt
Scanner working in thread. If user close window, thread still running and
program finishing unexpectedly. So, how can I close all threads before
exiting program?
Best regards,
Nick.
--
За використання революційного клієнта електронної пошти Opera:
http://www.opera.com/mail/
_______________________________________________
Qt-interest mailing list
Qt-interest at qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-interest
____________________________________________________________________________
This email is intended for the sole use of the intended recipient/s. Any review or copying or distribution or forwarding of any or all of the contents in this message is strictly prohibited. If you were not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.
More information about the Qt-interest-old
mailing list