waiting for approval

Boehm, Hans hans_boehm@hp.com
Wed Feb 6 17:26:00 GMT 2002


 
This sounds OK.  Thanks.  But couldn't you deal with the dll case by
defining GC_CreateThread to just call CreateThread in that case?  It seems
to me that should both allow old dll-based clients of the GC to continue to
work as before, and it should allow libgcj to work with both static and
dynamic linking?

I'd be happy to see this checked in, preferably with that change.

Hans

-----Original Message-----
From: Adam Megacz
To: Boehm, Hans
Cc: 'java-patches@gcc.gnu.org '
Sent: 2/6/02 11:21 AM
Subject: Re: waiting for approval


"Boehm, Hans" <hans_boehm@hp.com> writes:
> The second and third also look OK, except that it looks to me like
threads
> will be registered twice if the GC is actually in a dll, once using
the new
> mechanism, and once using the old?

Yes. That is the case.

> Probably the right thing to do is to check for and ignore duplicates
> whenever a thread is added to the thread table, and to deal with
> duplicate removals correspondingly.

I don't really feel comfortable modifying that code -- I'm pretty
worried that I'd break something.

> If it actually works with dynamic libraries, I'd be happy if you
> just add a FIX ME comment for now.

Unfortunately, I haven't been able to get shared linkage working, so I
can't test this.

Here's my solution: originally, GC_CreateThread only compiled #ifdef
MSWINCE. My original patch changed this to #ifdef WIN32.

Now I've changed it to:

  #if defined(MSWINCE) || (defined(__MINGW32__) && !defined(_DLL))

Hence, if you try to build libgcjgc as a dll, and try to build libgcj
against it, it will fail (link failure since GC_CreateThread won't be
defined). This way people get a compiler error rather than bizarre and
hard-to-debug runtime issues.

This should serve as a warning to anybody who tries to build
libgcj.dll and libgcjgc.dll -- that that configuration has not yet
been tested, and that additional code needs to be added.

Once I've got everything working with static linkage, I'll come back
and work on shared linkage.

Sound good? I'll post a patch in a few minutes.

  - a



More information about the Java-patches mailing list