volatile is not providing synchronization guarantees in the standard. Even
if it may work on most platforms with bool, this is not a good practice.

std::atomic<bool> or QAtomicInt will do the job.

2014-03-24 13:40 GMT+01:00 André Somers <an...@familiesomers.nl>:

>  Protecting it with a mutex is usually not needed, and it doesn't need to
> be global either. However, you may want to use a QAtomicInt or a
> volatile bool as your flag type, and you can make that a member variable
> of your worker class that can be set with a simple method call.
>
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to