[Lazarus] Threads and Libraries (dll and so)
pascaldragon at googlemail.com
Mon Jan 20 15:47:11 CET 2014
Am 20.01.2014 14:47 schrieb "Michael Schnell" <mschnell at lumino.de>:
> On 01/20/2014 11:01 AM, Michael Van Canneyt wrote:
>> "Note that QCoreApplication::exec() must always be called from the main
>> (the thread that executes main()), not from a QThread. In GUI
>> the main thread is also called the GUI thread because it's the only
>> that is allowed to perform GUI-related operations."
> I didn't think that in Linux with NPTL there not even is a thing like a
"main thread" of a program, but (before binding to a GUI provider) all
threads of a project are equivalent. As a consequence, multiple of them
should be able to be bound to a GUI provider instance - as long as same
does not impose global variable.
For Qt the main thread is the thread that first called
QCoreApplication::exec() (or that first constructed a QCoreApplication
instance? I'd need to check that again...). This is ensured using the
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Lazarus