From fc0738da5a027a757820f808bde7748d23436f2c Mon Sep 17 00:00:00 2001 From: schmidt Date: Sat, 24 May 1997 19:18:23 +0000 Subject: *** empty log message *** --- ChangeLog-97a | 60 +++++++++++++++++++++++++++++---- README | 1 - ace/Connector.cpp | 13 +++++-- ace/OS.cpp | 35 +++++++++++-------- ace/OS.h | 7 ++++ ace/OS.i | 13 +++++-- ace/README | 2 ++ ace/Reactor.cpp | 2 +- ace/Sched_Params.cpp | 12 +++++-- ace/Thread_Manager.h | 2 +- ace/config-chorus.h | 4 ++- ace/config-hpux-9.x.h | 4 ++- include/makeinclude/platform_chorus.GNU | 25 ++++++++------ 13 files changed, 135 insertions(+), 45 deletions(-) diff --git a/ChangeLog-97a b/ChangeLog-97a index 9646c84f309..a912bfa12f9 100644 --- a/ChangeLog-97a +++ b/ChangeLog-97a @@ -1,3 +1,37 @@ +Sat May 24 12:07:48 1997 Douglas C. Schmidt + + * ace/Reactor.cpp (bind): Fixed a stupid typo where I was using + the ACE_REACTOR_EVENT_HANDLER macro instead of the + ACE_REACTOR_HANDLE macro. Thanks to Detlef for reporting this. + + * ace/OS.i: Added a new macro called ACE_HAS_THR_MINSTACK to deal + with weirdo mangling of names by Tandem. Thanks to Jan Perman + for reporting this. + + * ace/OS.h: Added a new macro ACE_LACKS_PRI_T for those platforms + using STHREADS (e.g., Tandem NonStop OS) that don't have pri_t + defined. Thanks to Jan Perman for + reporting this. + + * ace/Connector.cpp (connect): Make sure to save/restore errno + since svc_handler->close() may change it. Thanks to Michael + Hartman for reporting this. + + * include/makeinclude/platform_chorus.GNU: Added a new platform + macros file for Chorus. Thanks to Wei Chang for this. + + * ace/OS.cpp (sched_params): Reordered the #ifdefs so that Chorus + comes first. + + * ace/OS.i (sleep): If the platform defines ACE_HAS_CLOCK_GETTIME + then we'll use the nanosleep() method rather than sleep(). + + * ace/OS.h: disabled THR_NEW_LWP for Chorus. Thanks to Wei Chang + for reporting this. + + * ace/Sched_Params.cpp: ACE_SCHED_OTHER and ACE_SCHED_RR have the + same value on Chorus. Thanks to Wei Chang for reporting this. + Sat May 24 09:21:08 1997 David L. Levine * netsvcs/lib/Server_Logging_Handler.cpp: protected second @@ -32,6 +66,20 @@ Sat May 24 01:53:22 1997 James C Hu Sandro Doro, squashed a bug where we were trying to concatenate onto a string constant. +Fri May 23 01:01:01 1997 Douglas C. Schmidt + + * ace/config-hpux-9.x.h: Added + + #define ACE_HAS_BROKEN_ENUMS + #define ACE_HAS_IP_MULTICAST + #define ACE_LACKS_GETPGID + + Thanks to Neil Cohen for reporting these. + + * ace/Thread_Manager.h: Made the private methods and data members + protected so that subclasses can extend it. Thanks to Hamutal + Yanay for this suggestion. + Fri May 23 21:27:05 1997 David L. Levine * ace/Process.{h,cpp} (env_argv): added "const" to char * type in @@ -72,13 +120,6 @@ Fri May 23 21:27:05 1997 David L. Levine close the Task, and added printout to main () after all tasks have been spawned to help debug non-termination. -Fri May 23 20:12:33 1997 James C Hu - - * tests/SV_Shared_Memory_Test.cpp: Thanks to Chuck Gehr, fixed - ASCII dependent code in the parent and child routines. - -Fri May 23 10:11:26 1997 David L. Levine - * ace/OS.cpp: (thr_create, with STHREADS only): *thr_handle was used but *thr_id had been set by ::thr_create, so threads never got activated. Fixed by using *thr_id instead of *thr_handle @@ -86,6 +127,11 @@ Fri May 23 10:11:26 1997 David L. Levine Thanks to Jan Perman for reporting this problem. +Fri May 23 20:12:33 1997 James C Hu + + * tests/SV_Shared_Memory_Test.cpp: Thanks to Chuck Gehr, fixed + ASCII dependent code in the parent and child routines. + Fri May 23 02:58:28 1997 Nanbor Wang * ace/OS.i (dlsym): Added ACE_USES_ASM_SYMBOL_IN_DLSYM, support diff --git a/README b/README index b47ef10e0bf..a28290ceb3d 100644 --- a/README +++ b/README @@ -490,7 +490,6 @@ Scott Halstead Jean-Marc Strauss Adam Porter Hakan Kallberg -Carlos O'Ryan Eric Dean Russell Daniel Montalibet Norbert Rapp diff --git a/ace/Connector.cpp b/ace/Connector.cpp index 2ab0ec98708..a5f405de623 100644 --- a/ace/Connector.cpp +++ b/ace/Connector.cpp @@ -361,9 +361,16 @@ ACE_Connector::connect (SH *&sh, this->create_AST (sh, synch_options); } else - // Make sure to close down the Channel to avoid descriptor - // leaks. - sh->close (0); + { + // Make sure to save/restore the errno since may + // change it. + + int error = errno; + // Make sure to close down the Channel to avoid descriptor + // leaks. + sh->close (0); + errno = error; + } return -1; } else diff --git a/ace/OS.cpp b/ace/OS.cpp index 7d76f0b5ba7..450c4d2f129 100644 --- a/ace/OS.cpp +++ b/ace/OS.cpp @@ -466,7 +466,19 @@ int ACE_OS::sched_params (const ACE_Sched_Params &sched_params) { // ACE_TRACE ("ACE_OS::sched_params"); -#if defined (ACE_HAS_STHREADS) +#if defined (CHORUS) + int result; + struct sched_param param; + ACE_thread_t thr_id = ACE_OS::thr_self (); + + param.sched_priority = sched_params.priority (); + + ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::pthread_setschedparam (thr_id, + sched_params.policy (), + ¶m), + result), + int, -1); +#elif defined (ACE_HAS_STHREADS) // Set priority class, priority, and quantum of this LWP or process as // specified in sched_params. @@ -631,19 +643,6 @@ ACE_OS::sched_params (const ACE_Sched_Params &sched_params) // Set the thread priority on the current thread. return ACE_OS::thr_setprio (sched_params.priority ()); - -#elif defined (CHORUS) - int result; - struct sched_param param; - ACE_thread_t thr_id = ACE_OS::thr_self (); - - param.sched_priority = sched_params.priority (); - - ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::pthread_setschedparam (thr_id, - sched_params.policy (), - ¶m), - result), - int, -1); #else ACE_UNUSED_ARG (sched_params); ACE_NOTSUP_RETURN (-1); @@ -1281,6 +1280,14 @@ ACE_OS::thr_create (ACE_THR_FUNC func, stacksize = ACE_NEEDS_HUGE_THREAD_STACKSIZE; # endif /* ACE_NEEDS_HUGE_THREAD_STACKSIZE */ +# if defined (CHORUS) + // if it is a super actor, we can't set stacksize. + // But for the time bing we are all non-super actors + // To be fixed later + if (stacksize == 0) + stacksize = 0x100000; +# endif /*CHORUS */ + if (stacksize != 0) { size_t size = stacksize; diff --git a/ace/OS.h b/ace/OS.h index 21956cc1d25..5c9b851f472 100644 --- a/ace/OS.h +++ b/ace/OS.h @@ -1073,7 +1073,11 @@ typedef pthread_mutex_t ACE_thread_mutex_t; # endif /* ACE_HAS_DCETHREADS */ # define THR_BOUND 0x00000001 +# if defined (CHORUS) +# define THR_NEW_LWP 0x00000000 +# else # define THR_NEW_LWP 0x00000002 +# endif /* CHORUS */ # define THR_DETACHED 0x00000040 # define THR_SUSPENDED 0x00000080 # define THR_DAEMON 0x00000100 @@ -2076,6 +2080,9 @@ extern "C" #if defined (ACE_HAS_STHREADS) #include /**/ +#if defined (ACE_LACKS_PRI_T) +typedef int pri_t; +#endif /* ACE_LACKS_PRI_T */ typedef id_t ACE_id_t; typedef pri_t ACE_pri_t; #else diff --git a/ace/OS.i b/ace/OS.i index c0522dd462c..5826e096cbd 100644 --- a/ace/OS.i +++ b/ace/OS.i @@ -4137,9 +4137,16 @@ ACE_OS::thr_min_stack (void) // ACE_TRACE ("ACE_OS::thr_min_stack"); #if defined (ACE_HAS_THREADS) #if defined (ACE_HAS_STHREADS) +#if defined (ACE_HAS_THR_MINSTACK) + // Tandem did some weirdo mangling of STHREAD names... + ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::thr_minstack (), + ace_result_), + int, -1); +#else ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::thr_min_stack (), - ace_result_), - int, -1); + ace_result_), + int, -1); +#endif /* !ACE_HAS_THR_MINSTACK */ #elif (defined (ACE_HAS_DCETHREADS) || defined (ACE_HAS_PTHREADS)) && !defined (ACE_HAS_SETKIND_NP) #if defined (ACE_HAS_IRIX62_THREADS) return (size_t) ACE_OS::sysconf (_SC_THREAD_STACK_MIN); @@ -6372,7 +6379,7 @@ ACE_OS::sleep (u_int seconds) #if defined (ACE_WIN32) ::Sleep (seconds * 1000); return 0; -#elif defined (VXWORKS) +#elif defined (ACE_HAS_CLOCK_GETTIME) struct timespec rqtp; // Initializer doesn't work with Green Hills 1.8.7 rqtp.tv_sec = seconds; diff --git a/ace/README b/ace/README index 129abaedc40..18e453add2f 100644 --- a/ace/README +++ b/ace/README @@ -57,6 +57,7 @@ ACE_HAS_IP_MULTICAST Platform supports IP multicast ACE_HAS_IRIX_GETTIMEOFDAY Denotes that IRIX 5.3 has second argument to gettimeofday() which is variable ... ACE_HAS_IRIX62_THREADS Platform supports the very odd IRIX 6.2 threads... ACE_HAS_THR_KEYDELETE Platform supports thr_keydelete (e.g,. UNIXWARE) +ACE_HAS_THR_MINSTACK Platform calls thr_minstack() rather than thr_min_stack() (e.g., Tandem). ACE_HAS_LIMITED_RUSAGE_T The rusage_t structure has only two fields. ACE_HAS_LONGLONG_T Compiler/platform supports the "long long" datatype. ACE_HAS_LONG_MAP_FAILED Platform defines MAP_FAILED as a long constant. @@ -188,6 +189,7 @@ ACE_LACKS_NETDB_REENTRANT_FUNCTIONS Platform does not support reentrant netdb fu ACE_LACKS_RPC_H Platform lacks the ONC RPC header files. ACE_LACKS_PARAM_H Platform lacks (e.g., MVS) ACE_LACKS_POSIX_PROTO Platform lacks POSIX prototypes for certain System V functions like shared memory and message queues. +ACE_LACKS_PRI_T Platform lacks pri_t (e.g., Tandem NonStop UNIX). ACE_LACKS_PTHREAD_CANCEL Platform lacks pthread_cancel(). ACE_LACKS_PTHREAD_THR_SIGSETMASK Platform lacks pthread_thr_sigsetmask (e.g., MVS, HP/UX, and OSF/1 3.2) ACE_LACKS_PWD_REENTRANT_FUNCTIONS Platform lacks getpwnam_r() methods (e.g., SGI 6.2). diff --git a/ace/Reactor.cpp b/ace/Reactor.cpp index 70b04a8a371..2373f5fa0c6 100644 --- a/ace/Reactor.cpp +++ b/ace/Reactor.cpp @@ -212,7 +212,7 @@ ACE_Reactor_Handler_Repository::bind (ACE_HANDLE handle, break; } // Here's the first free slot, so let's take it. - else if (ACE_REACTOR_EVENT_HANDLER (this, i) == ACE_INVALID_HANDLE + else if (ACE_REACTOR_HANDLE (i) == ACE_INVALID_HANDLE && assigned_slot == -1) assigned_slot = i; } diff --git a/ace/Sched_Params.cpp b/ace/Sched_Params.cpp index adca11a096f..6701f605313 100644 --- a/ace/Sched_Params.cpp +++ b/ace/Sched_Params.cpp @@ -80,7 +80,9 @@ ACE_Sched_Params::priority_min (const Policy policy, return ACE_THR_PRI_FIFO_MIN; case ACE_SCHED_RR: return ACE_THR_PRI_RR_MIN; - case ACE_SCHED_OTHER: +#if !defined (CHORUS) // SCHED_OTHRE and SCHED_RR have same value + case ACE_SCHED_OTHER: +#endif /* CHORUS */ default: return ACE_THR_PRI_OTHER_MIN; } @@ -93,7 +95,9 @@ ACE_Sched_Params::priority_min (const Policy policy, return ACE_PROC_PRI_FIFO_MIN; case ACE_SCHED_RR: return ACE_PROC_PRI_RR_MIN; - case ACE_SCHED_OTHER: +#if !defined (CHORUS) // SCHED_OTHRE and SCHED_RR have same value + case ACE_SCHED_OTHER: +#endif /* CHORUS */ default: return ACE_PROC_PRI_OTHER_MIN; } @@ -171,7 +175,9 @@ ACE_Sched_Params::priority_max (const Policy policy, return ACE_PROC_PRI_FIFO_MAX; case ACE_SCHED_RR: return ACE_PROC_PRI_RR_MAX; - case ACE_SCHED_OTHER: +#if !defined (CHORUS) // SCHED_OTHRE and SCHED_RR have same value + case ACE_SCHED_OTHER: +#endif /* CHORUS */ default: return ACE_PROC_PRI_OTHER_MAX; } diff --git a/ace/Thread_Manager.h b/ace/Thread_Manager.h index ac486095846..b5d96080c9b 100644 --- a/ace/Thread_Manager.h +++ b/ace/Thread_Manager.h @@ -289,7 +289,7 @@ protected: ACE_Task_Base *task = 0); // Create a new thread (must be called with locks held). -private: +protected: int resize (size_t); // Resize the pool of Thread_Descriptors. diff --git a/ace/config-chorus.h b/ace/config-chorus.h index 7008b8a62c6..ea98287a098 100644 --- a/ace/config-chorus.h +++ b/ace/config-chorus.h @@ -33,6 +33,7 @@ // got struct timespec #define ACE_HAS_POSIX_TIME +#define ACE_HAS_CLOCK_GETTIME #define ACE_LACKS_STRRECVFD #define ACE_HAS_CPLUSPLUS_HEADERS @@ -47,7 +48,8 @@ // Platforms lacks UNIX domain sockets. #define ACE_LACKS_UNIX_DOMAIN_SOCKETS #define ACE_LACKS_UTSNAME_T -#define ACE_LACKS_SETSCHED +#define ACE_HAS_PTHREADS_1003_DOT_1C +//#define ACE_LACKS_SETSCHED #define ACE_LACKS_MSYNC #define ACE_LACKS_MADVISE diff --git a/ace/config-hpux-9.x.h b/ace/config-hpux-9.x.h index c62f41a1c30..6ec331e3dee 100644 --- a/ace/config-hpux-9.x.h +++ b/ace/config-hpux-9.x.h @@ -16,7 +16,9 @@ #define ACE_HAS_BROKEN_HPUX_TEMPLATES #endif /* __cplusplus < 199707L */ -#define ACE_HAS_BROKEN_ENUM +#define ACE_HAS_BROKEN_ENUMS +#define ACE_HAS_IP_MULTICAST +#define ACE_LACKS_GETPGID #define ACE_HAS_BROKEN_CONVERSIONS // They forgot a const in the prototype of const_timewait... diff --git a/include/makeinclude/platform_chorus.GNU b/include/makeinclude/platform_chorus.GNU index 92ad506784f..973c7f90c67 100644 --- a/include/makeinclude/platform_chorus.GNU +++ b/include/makeinclude/platform_chorus.GNU @@ -1,11 +1,12 @@ # Chorus 3.1b with GNU g++ 2.7.2 -# *not* using Orbix +include $(CLASSIXDIR)/dtool/htgt-cf.rf INC_DIR = $(CLASSIXDIR)/include BIN_DIR = LIB_DIR = $(CLASSIXDIR)/lib -CC = gcc -CXX = g++ +#CC = gcc +#CXX = g++ +CXX = $(CC) CFLAGS += $(DCFLAGS) -w -O2 CCFLAGS += $(CFLAGS) -fno-implicit-templates \ -fno-strict-prototypes \ @@ -17,20 +18,24 @@ INCLDIRS += -I$(INC_DIR)/posix \ -I$(INC_DIR)/stdc \ -I$(INC_DIR)/chorus/ \ -I$(INC_DIR)/chorus/iom \ - -I$(INC_DIR)/CC -DLD = -LD = $(CXX) + -I$(INC_DIR)/CC +DLD = +LD = $(CXX) LDFLAGS += -r -Ur -nostdlib \ -L$(LIB_DIR)/CC \ -L$(LIB_DIR)/classix -LIBS += -lC -lcx.u +#LIBS += -lC -lcx.u PIC = -fPIC -AR = ar -ARFLAGS = rv -RANLIB = /bin/true +#AR = ar +AR = $(XDIR)/bin/ar +#ARFLAGS = rv +ARFLAGS = srv +#RANLIB = /bin/true +RANLIB = $(XDIR)/bin/ranlib PRELIB = (echo "main() { }" > gcctemp.c && \ $(COMPILE.cc) -o gcctemp.o gcctemp.c && \ $(LD) $^ $(LDFLAGS) $(LIBS); \ status=$$?; rm -f gcctemp.* a.out; exit $$status) #### don't build shared objects: BUILD = $(VOBJS) $(VLIB) $(VBIN) + -- cgit v1.2.1