[Development] Using platform-native APIs for terminating QThreads

Thiago Macieira thiago.macieira at intel.com
Tue Sep 6 01:48:05 CEST 2016


Em segunda-feira, 5 de setembro de 2016, às 18:46:04 PDT, Alexander Nassian 
escreveu:
> Please don’t get me wrong, but that would imply that if enough people (for
> whatever reason) expect eg. QSettings to be compatible with WinAPI calls
> that should be changed. If I’m not wrong QThread doesn’t event expose the
> native handle in a reliable way, so why should Qt support API abuse by the
> user?

That's exactly our position: we've never promised it and, unlike std::thread, 
we do not expose the native handle. And yet the native handle is trivially 
easy to get from inside the thread (call pthread_self()) and pthread_exit() 
doesn't even require the handle. So it's entirely within the realm of 
possibility that people expect POSIX semantics to apply. We're wondering how 
much we have to strive to keep that compatibility we had never promised.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Development mailing list