This is the mail archive of the mailing list for the pthreas-win32 project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: pthreads VCE: problem with destructor

Hi Mike,

> Yeah, I have encountered similar problems. I presume
> you are using MS VC++ 6.0 and that these disappearing
> destructors affect your release build but not your
> debug build?

Just wanted to let you know that the problem occurs in debug build as well.
I tried two things:

1. the pthreads distribution, compiled using the command-line VC++
compiler/linker (that contains the full debug info, no optimisations) ->
added a test 'exit4.c' that fails, as described in my previous mail

2. pthreads library compiled from VC++ GUI environment (pthreads.dsp + a
test project). This was a bit more complex than the 'exit4.c' test but also
failed - in both debug (no optimisations) and release builds

I eventually tracked the problem down to

  extern "C"



function declaration+definition. If the exception is thrown from a function
that was exported as extern "C" from the DLL, destructor is not called
(stack rollback is not performed). On the other hand if the exception is
thrown from a function exported as extern (C++ name mangling and co.), there
is no problem at all (full stack rollback -> destructor call).

Anyway I liked the contribution from John Bossom and will support the
removal of VCE version of pthreads from the library as suggested by Ross
Johnson. I think the C++ stuff introduces more problems than it fixes...



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]