Suggestion about including pthread.h (original) (raw)
David Holmes david.holmes at oracle.com
Fri Mar 2 07:53:27 UTC 2012
- Previous message: Suggestion about including pthread.h
- Next message: Suggestion about including pthread.h
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 2/03/2012 5:05 PM, Shi Jun Zhang wrote:
Currently jdk/src/solaris/bin/javamd.c includes <pthread.h> with "#ifdef linux", but BSD, MAC OS, AIX all needs to include pthread.h. To avoid the situation that the ifdef clause becomes longer and longer like "#if defined(linux) || defined(ALLBSDSOURCE) || defined(AIX) || defined(OTHERPLATFORMS)", i suggest to use USEPTHREADS already defined in jdk/make/common/Defs-linux.gmk and add a compiler flag if USEPTHREADS is true. It will look like this: ifeq ($(USEPTHREADS), true) CPPFLAGSCOMMON += -DUSEPTHREADS endif
And then all the places need to include pthread.h only needs to use "#ifdef USEPTHREADS". The files include pthread.h are jdk/src/solaris/bin/javamd.c jdk/src/solaris/native/sun/nio/ch/NativeThread.c jdk/src/solaris/transport/socket/socketmd.c Any comments?
Yes we need to move to a more capability based inclusion & conditional compilation mechanism. I'm not sure if the build-infra project is tackling this particular case.
David
- Previous message: Suggestion about including pthread.h
- Next message: Suggestion about including pthread.h
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]