07.02.2018 15:21, Mark Rotteveel wrote:
On 7-2-2018 13:54, Vlad Khorsun via Firebird-devel wrote:
07.02.2018 14:41, Mark Rotteveel wrote:
On 7-2-2018 12:36, Vlad Khorsun via Firebird-devel wrote:
07.02.2018 13:26, Mark Rotteveel wrote:
On 7-2-2018 11:55, Mark Rotteveel wrote:
Shouldn't the engine be able to cope with this?

   Yes, and fb_shutdown handle it. But it can't handle it correctly when process
exits and Windows already unloaded some dlls and kill all other threads.

That seems at odds with the documentation.

   Documentation is not correct, unfortunately. It was written from Linux 
perspective,
at times when such cases as current one was not known.

Ok. That means that the documentation may need to be revised there.

  Yes, sure.

  BTW, in Firebird 3 role of fb_shutdown is even more important as it uses 
plugin
architecture and many code layers are at separate DLL's now.

I was just experimenting with Jaybird, and I noticed an odd inconsistency with fb_shutdown_callback on Windows. For other callbacks in fbclient (ie the event callback), I must define the callback using StdCall calling conventions.

  Hmm...

If I don't, things break. For the shutdown callback, using the 'normal' JNA calling convention (which I assume is cdecl) just works.

  In ibase.h all callback prototypes are declared not using ISC_EXPORT macro 
(this macro
expands into __stdcall). So, i see no inconsistency there: (almost) all ISC API
functions declared using ISC_EXPORT and all callbacks are without ISC_EXPORT.

However with fb_shutdown_callback, if I do apply the StdCall convention, then the callback is invoked, but the application ends with error 0xC0000409 ('unknown exception').

  As expected.

I haven't (yet) defined the method fb_shutdown_callback to explicitly accept the StdCall callback (contrary to isc_queue_events), but I'm surprised that it actually works without changing the calling convention. Is this something specific to the shutdown callback?

  So far i see no specific here.

Regards,
Vlad


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to