[Lazarus] Threads and Libraries (dll and so)

Sven Barth 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:
>> http://qt-project.org/doc/qt-4.8/threads-starting.html
>> "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
thread's ID.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20140120/e997eea5/attachment-0003.html>

More information about the Lazarus mailing list