Kay Ramme - Sun Germany - Hamburg wrote:
>> Moreover the problem is not that the SolarMutex must be locked to create
>> a vcl window (which is also true, but beside the point). The problem
>> here is that all of vcl's system windows must be created on one thread
>> (the main thread) or several operations will silently fail - things like
>> drawing, clipboard, DnD, OLE and the like ;-). Or so I was told (being
>> far from a Windows expert myself). Please correct me anyone if I'm wrong
>> here.
> This is true. The Win32 window and message related APIs are what I call
> thread-affine. This thread-affinity was tried to be solved by using
> "SendMessage", which IMHO can not work, as the thread switching does
> only happen happen while the target thread is in a message related Win32
> function, which it can not be, because it only calls these by request of
> VCL, which it can not enter, because the message sending thread already
> entered it ...
How sure are you that thread switching can only happen in a "message
related function" ? Then what exactly constitutes a "message related"
function ? Most likely the main thread would be either waiting for the
solar mutex (basically in osl_acquireMutex, that is probably in
EnterCriticalSection) or it would wait for events and has released the
solar mutex anyway (this is the most likely case, the main thread is
yielding and therefore has released the solar mutex) and waits in
GetMessage anyway, which certainly qualifies as "message realated" ;-) .
Kind regards, pl
--
If you give someone a program, you will frustrate them for a day;
if you teach them how to program, you will frustrate them for a lifetime.
-- Author unknown
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]