comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Ada DLL called from C
Date: Tue, 9 Aug 2016 19:15:46 +0200
Date: 2016-08-09T19:15:46+02:00	[thread overview]
Message-ID: <nod346$q7k$1@gioia.aioe.org> (raw)
In-Reply-To: 1470761116.15636.91.camel@obry.net

On 2016-08-09 18:45, Pascal Obry wrote:
> Le mardi 09 août 2016 à 18:29 +0200, Dmitry A. Kazakov a écrit :
>> You mean a DLL may not have library-level tasks? I was not aware of
>> this, but that could be the reason indeed. I have some library-level
>> tasks.
>
> A DLL cannot create tasks during its initialization indeed. This means
> that you cannot create task in DllMain entry point. So a DLL cannot
> have a library level task. You can use an access to task and initialize
> it later.
>
>> 1. Do you know the reason why?
>
> I don't know, that's just a plain limitation of Windows. Nothing to do
> with GNAT.

Well, under Windows you cannot create threads while in DllMain. More 
precisely you can, but the thread will not be activated until you leave 
DllMain. It is not a limitation that Ada RTS could not work around. But 
it looks that it does not.

>> 2. Why binder does not warn me about that? It is a statically
>> detectable case.
>
> The binder does not know you're building a task, does it?

It should know I am building a DLL. At least gprbuild knows that and it 
can pass the information further.

Thank you for the hint! You've saved me weeks of struggling with GDB.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


      parent reply	other threads:[~2016-08-09 17:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-09 10:11 Ada DLL called from C Dmitry A. Kazakov
2016-08-09 16:18 ` Pascal Obry
2016-08-09 16:29   ` Dmitry A. Kazakov
2016-08-09 16:45     ` Pascal Obry
2016-08-09 17:05       ` Pascal Obry
2016-08-09 17:15       ` Dmitry A. Kazakov [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox