diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1996-11-26 09:39:26 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1996-11-26 09:39:26 +0000 |
commit | bd6ddc52daef2a49e8cc7fc210236d6f75917fff (patch) | |
tree | 181a2e9edcb2dd8c227a19ab56ec067f7933d675 | |
parent | 7b844f59e70f35915cca9bddbb0691e10221e468 (diff) | |
download | ATCD-bd6ddc52daef2a49e8cc7fc210236d6f75917fff.tar.gz |
eee
34 files changed, 314 insertions, 135 deletions
diff --git a/ChangeLog-96b b/ChangeLog-96b index 46c921501f3..99154d7bda2 100644 --- a/ChangeLog-96b +++ b/ChangeLog-96b @@ -1,3 +1,25 @@ +Tue Nov 26 00:36:16 1996 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> + + * ace/Singleton.h: Modified the use of the ACE_NEW_RETURN macro so + we not only check if new has failed, but also check that the + constructor has succeeded. If it hasn't, we bail out... Thanks + to Luca for this suggestion. + + * ace/Log_Msg: Added a 4th parameter to log_hexdump() in order to + print out a comment. Thanks to Luca for this. + + * ace/ACE.cpp (ldfind): Changed the implementation to look for + ACE_DLL_SUFFIX rather than '.' since '.' might exist in the + pathname already... + + * Removed all the NT-specific svc.conf files and updated the other + files to use the new "auto-dll-suffix" feature in ACE. + + * ace/Synch_T.cpp (ts_get): Fixed a nasty bug introduced by recent + changes to ACE_TSS<>::ts_get(). The ACE_Mutex should be + ACE_Thread_Mutex. This should fix lots of nasty run-time bugs + seen with recent versions of the ACE 0.33 beta... + Tue Nov 26 03:15:22 1996 Irfan Pyarali <irfan@flamenco.cs.wustl.edu> * tests: Added Map_Manager_Test and Message_Queue_Test to @@ -6,11 +28,63 @@ Tue Nov 26 03:15:22 1996 Irfan Pyarali <irfan@flamenco.cs.wustl.edu> * tests: (Barrier_Test.cpp Buffer_Stream_Test.cpp Mutex_Test.cpp Priority_Buffer_Test.cpp Recursive_Mutex_Test.cpp Shared_Memory_MM_Test.cpp) Fixed typos mainly and other small - changes. Also fixed logging file problems so to make logging of - tests more accurate. + changes. Also fixed logging file problems so to make logging + of tests more accurate. Mon Nov 25 00:23:40 1996 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu> + * performance-tests/Synch-Benchmarks/Options.cpp (Options): + Reordered the initialization of data members to keep G++ from + complaining. + + * performance-tests/Synch-Benchmarks/pipe_thr_test.cpp: Changed + some types so that we don't get warnings. + + * tests/Mutex_Test.cpp (test): Added a "return 0". Thanks to + David Levine for reporting this. + + * ace/TTY_IO.cpp: Rearranged some definitions so that we don't get + "unused variable" warnings from g++. + + * ace/SOCK_Dgram.cpp (recv): Rearranged some definitions so that + we don't get "unused variable" warnings from g++. + + * tests/Priority_Buffer_Test.cpp (consumer): Fixed a typo -- I was + missing a *... Thanks to David Levine for reporting this. + + * ace/OS.h (ACE_SVC_FACTORY_DECLARE): Changed the macro so that it + defines a function with `extern "C"' linkage in order to be + consistent. + + * ace/OS.cpp (thr_create): Moved the conditional compilation test + for ACE_HAS_THR_C_FUNC outside of ACE_HAS_SETKIND_NP since MVS + doesn't have this! Thanks to Chuck Gehr for this info. + + * ace/OS.i (thr_sigsetmask): Replaced the tests for + ACE_HAS_DCETHREADS and ACE_HAS_SETKIND_NP with + ACE_LACKS_PTHREAD_THR_SIGSETMASK, which is more appropriate. + + * ace/OS.cpp (ace_mutex_lock_cleanup_adapter): Changed the + signature so that it returns "void" rather than "void *". + Thanks to Chuck Gehr for this. + + * ace/OS.h: Removed #include <sys/param.h> to avoid problems on + MVS. Thanks to Chuck Gehr for this. + + * ace/config-sunos5.5-sunc++-4.1.h: It looks like SunC++ 4.1 still + doesn't fix their template typedefs bugs. So I've commented + this out in the config file. Thanks to Fred LaBar + <flabar@fallschurch.esys.com> for reporting this. + + * ace/ACE.cpp (ldfind): Added support for a new feature that will + append the default suffix (e.g., ".dll" or ".so") for a shared + library on the current platform to the name of the file if it + cannot find an suffix. It will also check that a provided + suffix will match the default suffix for that platform and if it + doesn't it will produce a log entry with a warning. This change + will allow unified svc.conf-files for both UNIX and WinNT. + Thanks to Tilo Christ <christ@swl.fh-heilbronn.de> for this. + * ace/OS.cpp (thr_create): Came up with a remarkably clever scheme that should make it possible to utilize the ACE library *without change* on MVS, where the frigging C++ compiler requires all diff --git a/ace/ACE.cpp b/ace/ACE.cpp index 5ca941f54ee..73f9ac76c8e 100644 --- a/ace/ACE.cpp +++ b/ace/ACE.cpp @@ -112,11 +112,48 @@ ACE::ldfind (const char *filename, size_t maxlen) { ACE_TRACE ("ACE::ldfind"); - if (ACE_OS::strchr (filename, ACE_DIRECTORY_SEPARATOR_CHAR) != 0) + + char searchfilename[MAXPATHLEN]; + + // Determine, whether the default-suffix for shared libraries needs + // to be appended. + + if (ACE_OS::strstr (filename, ACE_DLL_SUFFIX) != 0) + // Use the filename as provided since it has a suffix. + ACE_OS::strncpy (searchfilename, filename, sizeof searchfilename); + else + { + if (ACE_OS::strlen (filename) + + ACE_OS::strlen (ACE_DLL_SUFFIX) + + 1 >= sizeof searchfilename) + { + errno = ENOMEM; + return -1; + } + else + ::sprintf (searchfilename, "%s%s", filename, ACE_DLL_SUFFIX); + } + + if (ACE_OS::strcmp (searchfilename + + ACE_OS::strlen(searchfilename) - ACE_OS::strlen (ACE_DLL_SUFFIX), + ACE_DLL_SUFFIX)) + ACE_ERROR ((LM_NOTICE, + "CAUTION: improper name for a shared library on this patform: %s\n", + searchfilename)); + + if (ACE_OS::strchr (searchfilename, ACE_DIRECTORY_SEPARATOR_CHAR) != 0) { // Use absolute pathname. - ACE_OS::strncpy (pathname, filename, maxlen); - return 0; + if (ACE_OS::strlen (searchfilename) >= maxlen) + { + errno = ENOMEM; + return -1; + } + else + { + ACE_OS::strncpy (pathname, searchfilename, maxlen); + return 0; + } } else { @@ -126,14 +163,14 @@ ACE::ldfind (const char *filename, if (ld_path != 0 && (ld_path = ACE_OS::strdup (ld_path)) != 0) { // Look at each dynamic lib directory in the search path. - char *path_entry = ACE_OS::strtok (ld_path, + char *path_entry = ACE_OS::strtok (ld_path, ACE_LD_SEARCH_PATH_SEPARATOR_STR); int result = 0; while (path_entry != 0) { - if (ACE_OS::strlen (path_entry) + 1 + ACE_OS::strlen (filename) >= maxlen) + if (ACE_OS::strlen (path_entry) + 1 + ACE_OS::strlen (searchfilename) >= maxlen) { errno = ENOMEM; result = -1; @@ -142,7 +179,7 @@ ACE::ldfind (const char *filename, ACE_OS::sprintf (pathname, "%s%c%s", path_entry, ACE_DIRECTORY_SEPARATOR_CHAR, - filename); + searchfilename); if (ACE_OS::access (pathname, R_OK) == 0) break; diff --git a/ace/ACE.h b/ace/ACE.h index f7f26351315..07410b481df 100644 --- a/ace/ACE.h +++ b/ace/ACE.h @@ -1,7 +1,6 @@ /* -*- C++ -*- */ // $Id$ - // ============================================================================ // // = LIBRARY diff --git a/ace/Future.cpp b/ace/Future.cpp index e95eeb3a860..1e245e8361b 100644 --- a/ace/Future.cpp +++ b/ace/Future.cpp @@ -33,8 +33,8 @@ ACE_Future_Rep<T>::dump (void) const template <class T> ACE_Future_Rep<T>::ACE_Future_Rep (void) - : ref_count_ (0), - value_ (0), + : value_ (0), + ref_count_ (0), value_ready_ (this->value_ready_mutex_) { } diff --git a/ace/Log_Msg.cpp b/ace/Log_Msg.cpp index b29169dc5f9..8c9d8f73d9c 100644 --- a/ace/Log_Msg.cpp +++ b/ace/Log_Msg.cpp @@ -654,7 +654,8 @@ ACE_Log_Msg::log (const char *format_str, int ACE_Log_Msg::log_hexdump (ACE_Log_Priority log_priority, char *buffer, - int size) + int size, + char *text) { char buf[ACE_Log_Record::MAXLOGMSGLEN - ACE_Log_Record::VERBOSE_LEN - 58]; // 58 for the HEXDUMP header; @@ -665,7 +666,13 @@ ACE_Log_Msg::log_hexdump (ACE_Log_Priority log_priority, int len = ACE::format_hexdump (buffer, size, buf, sizeof buf); - int sz = ::sprintf (msg_buf, "HEXDUMP %d bytes", size); + int sz = 0; + + if (text) + sz = ::sprintf (msg_buf, "%s - ", text); + + sz += ::sprintf (msg_buf + sz, "HEXDUMP %d bytes", size); + if (len < size) ::sprintf (msg_buf + sz, " (showing first %d bytes)", len); diff --git a/ace/Log_Msg.h b/ace/Log_Msg.h index 3563c5570db..5af0a8f5349 100644 --- a/ace/Log_Msg.h +++ b/ace/Log_Msg.h @@ -276,7 +276,8 @@ public: int log_hexdump (ACE_Log_Priority log_priority, char *buffer, - int size); + int size, + char *text = 0); // Method to log hex dump. This is useful for debugging. Calls // <log> to do the actual print, but formats first to make the chars // printable. diff --git a/ace/Naming_Context.h b/ace/Naming_Context.h index d705fe5ec5e..4198b786f63 100644 --- a/ace/Naming_Context.h +++ b/ace/Naming_Context.h @@ -314,6 +314,9 @@ private: // The context in which the naming database will be created. }; +// We can't use the ACE_SVC_FACTORY_DECLARE macro here because this +// needs to be in the ACE_Export context rather than the +// ACE_Svc_Export context. extern "C" ACE_Export ACE_Service_Object *_make_ACE_Naming_Context (void); #endif /* ACE_NAMING_CONTEXT_H */ diff --git a/ace/OS.cpp b/ace/OS.cpp index f143553a463..4f1816c1af1 100644 --- a/ace/OS.cpp +++ b/ace/OS.cpp @@ -844,26 +844,25 @@ ACE_OS::thr_create (ACE_THR_FUNC func, p_thr = (thr_id == 0 ? &tmp_thr : thr_id); #if defined (ACE_HAS_SETKIND_NP) + ACE_OSCALL (ACE_ADAPT_RETVAL (::pthread_create (p_thr, attr, func, args), + result), + int, -1, result); + ::pthread_attr_delete (&attr); +#else /* !ACE_HAS_SETKIND_NP */ #if defined (ACE_HAS_THR_C_FUNC) ACE_Thread_Adapter *thread_args; ACE_NEW_RETURN (thread_args, ACE_Thread_Adapter (func, args), -1); - ACE_OSCALL (ACE_ADAPT_RETVAL (::pthread_create (p_thr, attr, + ACE_OSCALL (ACE_ADAPT_RETVAL (::pthread_create (p_thr, &attr, ACE_THR_C_FUNC (&ace_thread_adapter), thread_args), result), int, -1, result); #else - ACE_OSCALL (ACE_ADAPT_RETVAL (::pthread_create (p_thr, attr, func, args), - result), - int, -1, result); -#endif /* ACE_HAS_THR_C_FUNC */ - - ::pthread_attr_delete (&attr); -#else /* !ACE_HAS_SETKIND_NP */ ACE_OSCALL (ACE_ADAPT_RETVAL (::pthread_create (p_thr, &attr, func, args), result), int, -1, result); +#endif /* ACE_HAS_THR_C_FUNC */ ::pthread_attr_destroy (&attr); #endif /* ACE_HAS_SETKIND_NP */ #if defined (ACE_HAS_STHREADS) @@ -1363,9 +1362,8 @@ siginfo_t::siginfo_t (ACE_HANDLE handle) // This is necessary to work around nasty problems with MVS C++. -extern "C" void * +extern "C" void ace_mutex_lock_cleanup_adapter (void *args) { ACE_OS::mutex_lock_cleanup (args); - return 0; } @@ -152,6 +152,12 @@ // depending on whether ANSI/ISO exception handling semantics are // being used). +#if 0 + else if (ACE_LOG_MSG->op_status () == -1) { \ + errno = ACE_LOG_MSG->errnum (); \ + delete POINTER; POINTER = 0; return; +#endif /* 0 */ + #define ACE_NEW(POINTER,CONSTRUCTOR) \ do { POINTER = new CONSTRUCTOR; \ if (POINTER == 0) { errno = ENOMEM; return; }} while (0) @@ -328,7 +334,7 @@ static ACE_Static_Svc_##X ace_static_svc_##X; #define ACE_SVC_FACTORY_DECLARE(X) extern "C" ACE_Svc_Export ACE_Service_Object *_make_##X (void); #define ACE_SVC_INVOKE(X) _make_##X () #define ACE_SVC_NAME(X) _make_##X -#define ACE_SVC_FACTORY_DEFINE(X) ACE_Service_Object *_make_##X () { ACE_TRACE (#X); return new X; } +#define ACE_SVC_FACTORY_DEFINE(X) extern "C" ACE_Service_Object *_make_##X () { ACE_TRACE (#X); return new X; } #if !(defined (ACE_HAS_THREADS) && defined (ACE_HAS_THREAD_SPECIFIC_STORAGE)) #define ACE_TSS_TYPE(T) T @@ -994,6 +1000,8 @@ typedef void (*ACE_SignalHandlerV)(...); #define ACE_LD_SEARCH_PATH "PATH" #define ACE_LD_SEARCH_PATH_SEPARATOR_STR ";" #define ACE_LOGGER_KEY "\\temp\\server_daemon" +#define ACE_DLL_SUFFIX ".dll" + // This will help until we figure out everything: #define NFDBITS 32 // only used in unused functions... // These two may be used for internal flags soon: @@ -1299,6 +1307,7 @@ typedef char TCHAR; #define ACE_LD_SEARCH_PATH "LD_LIBRARY_PATH" #define ACE_LD_SEARCH_PATH_SEPARATOR_STR ":" #define ACE_LOGGER_KEY "/tmp/server_daemon" +#define ACE_DLL_SUFFIX ".so" // Wrapper for NT events on UNIX. struct ACE_event_t @@ -1357,7 +1366,6 @@ extern "C" { #if defined (VXWORKS) #include /**/ <sys/times.h> #else -#include /**/ <sys/param.h> #include /**/ <sys/uio.h> #include /**/ <sys/ipc.h> #include /**/ <sys/shm.h> @@ -136,10 +136,10 @@ extern "C" char *mktemp (char *); #if defined (ACE_HAS_THR_C_FUNC) // This is necessary to work around nasty problems with MVS C++. -extern "C" void *ace_mutex_lock_cleanup_adapter (void *args); -#define ACE_PTHREAD_CLEANUP_PUSH(A) pthread_cleanup_push (ACE_THR_C_FUNC (ace_mutex_lock_cleanup_adapter), (void *) A)); +extern "C" void ace_mutex_lock_cleanup_adapter (void *args); +#define ACE_PTHREAD_CLEANUP_PUSH(A) pthread_cleanup_push (ace_mutex_lock_cleanup_adapter, (void *) A)); #else -#define ACE_PTHREAD_CLEANUP_PUSH(A) pthread_cleanup_push (ACE_THR_FUNC (ACE_OS::mutex_lock_cleanup), (void *) A)); +#define ACE_PTHREAD_CLEANUP_PUSH(A) pthread_cleanup_push (ACE_OS::mutex_lock_cleanup, (void *) A)); #endif /* ACE_HAS_THR_C_FUNC */ #if defined (ACE_HAS_REGEX) @@ -3207,7 +3207,7 @@ ACE_OS::thr_sigsetmask (int how, ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::thr_sigsetmask (how, nsm, osm), ace_result_), int, -1); -#elif defined (ACE_HAS_SETKIND_NP) || defined (ACE_HAS_DCETHREADS) +#elif defined (ACE_LACKS_PTHREAD_THR_SIGSETMASK) // DCE threads have no such function. ACE_NOTSUP_RETURN (-1); #elif defined (ACE_HAS_PTHREADS_1003_DOT_1C) diff --git a/ace/README b/ace/README index d0e1010906c..9b3ca25721c 100644 --- a/ace/README +++ b/ace/README @@ -136,6 +136,7 @@ ACE_LACKS_MSGBUF_T Platform lacks struct msgbuf (e.g., NT and MSV). ACE_LACKS_MSYNC Platform lacks msync() (e.g., Linux) ACE_LACKS_PARAM_H Platform lacks <sys/param.h> (e.g., MVS) ACE_LACKS_POSIX_PROTO Platform lacks POSIX prototypes for certain System V functions like shared memory and message queues. +ACE_LACKS_PTHREAD_THR_SIGSETMASK Platform lacks pthread_thr_sigsetmask (e.g., MVS, HP/UX, and OSF/1 3.2) ACE_LACKS_RECVMSG Platform lacks recvmsg() (e.g., Linux) ACE_LACKS_RPC_H Platform lacks the ONC RPC header files. ACE_LACKS_SBRK Platform lacks a working sbrk() (e.g., Win32 and VxWorks) diff --git a/ace/SOCK_Dgram.cpp b/ace/SOCK_Dgram.cpp index 5005738a653..0df5119b560 100644 --- a/ace/SOCK_Dgram.cpp +++ b/ace/SOCK_Dgram.cpp @@ -23,10 +23,9 @@ ssize_t ACE_SOCK_Dgram::recv (iovec *io_vec, ACE_Addr &addr, int flags) const { ACE_TRACE ("ACE_SOCK_Dgram::recv"); +#if defined (FIONREAD) sockaddr *saddr = (sockaddr *) addr.get_addr (); int addr_len = addr.get_size (); - -#if defined (FIONREAD) u_long inlen; if (ACE_OS::ioctl (this->get_handle (), diff --git a/ace/Singleton.cpp b/ace/Singleton.cpp index 5d6a6e8ea31..4a07aedb70c 100644 --- a/ace/Singleton.cpp +++ b/ace/Singleton.cpp @@ -44,7 +44,25 @@ ACE_Singleton<TYPE, LOCK>::instance (void) ACE_GUARD_RETURN (LOCK, ace_mon, ace_singleton_lock_, 0); if (instance_ == 0) - ACE_NEW_RETURN (instance_, TYPE, 0); + { + // We can replace the following lines with this line once we + // update the macro in OS.h + // ACE_NEW_RETURN (instance_, TYPE, 0); + + instance_ = new TYPE; + if (instance_ == 0) + { + errno = ENOMEM; + return 0; + } + else if (ACE_LOG_MSG->op_status () == -1) + { + errno = ACE_LOG_MSG->errnum (); + delete instance_; + instance_ = 0; + return 0; + } + } } return instance_; @@ -56,7 +74,25 @@ ACE_Singleton<TYPE, LOCK>::instance (void) ACE_GUARD_RETURN (LOCK, ace_mon, (ACE_Singleton<TYPE, LOCK>::ace_singleton_lock_), 0); if (ACE_Singleton<TYPE, LOCK>::instance_ == 0) - ACE_NEW_RETURN ((ACE_Singleton<TYPE, LOCK>::instance_), TYPE, 0); + { + // We can replace the following lines with this line once we + // update the macro in OS.h + // ACE_NEW_RETURN ((ACE_Singleton<TYPE, LOCK>::instance_), TYPE, 0); + + instance_ = new TYPE; + if (instance_ == 0) + { + errno = ENOMEM; + return 0; + } + else if (ACE_LOG_MSG->op_status () == -1) + { + errno = ACE_LOG_MSG->errnum (); + delete instance_; + instance_ = 0; + return 0; + } + } } return ACE_Singleton<TYPE, LOCK>::instance_; diff --git a/ace/Synch_T.cpp b/ace/Synch_T.cpp index fd89d2e26d5..6b7ff67dafe 100644 --- a/ace/Synch_T.cpp +++ b/ace/Synch_T.cpp @@ -310,7 +310,7 @@ ACE_TSS<TYPE>::ts_get (void) const if (this->once_ == 0) { // Insure that we are serialized! - ACE_GUARD_RETURN (ACE_Mutex, ace_mon_2, (ACE_Mutex &) this->keylock_, 0); + ACE_GUARD_RETURN (ACE_Thread_Mutex, ace_mon, (ACE_Thread_Mutex &) this->keylock_, 0); // Use the Double-Check pattern to make sure we only create the // key once! diff --git a/ace/TTY_IO.cpp b/ace/TTY_IO.cpp index 96d63e80618..5a14536b42d 100644 --- a/ace/TTY_IO.cpp +++ b/ace/TTY_IO.cpp @@ -200,6 +200,8 @@ ACE_TTY_IO::control (Control_Mode cmd, } // arg switch #else + cmd = cmd; + arg = arg; ACE_NOTSUP_RETURN (-1); #endif /* ACE_HAS_TERM_IOCTLS */ } diff --git a/ace/UPIPE_Stream.cpp b/ace/UPIPE_Stream.cpp index b4bffcee7ae..8f1b29a8596 100644 --- a/ace/UPIPE_Stream.cpp +++ b/ace/UPIPE_Stream.cpp @@ -14,9 +14,9 @@ ACE_ALLOC_HOOK_DEFINE(ACE_UPIPE_Stream) ACE_UPIPE_Stream::ACE_UPIPE_Stream (void) - : remaining_ (0), - reference_count_ (0), - mb_last_ (0) + : mb_last_ (0), + remaining_ (0), + reference_count_ (0) { ACE_TRACE ("ACE_UPIPE_Stream::ACE_UPIPE_STREAM"); } diff --git a/ace/config-aix-4.1.x.h b/ace/config-aix-4.1.x.h index 3f112248b52..3c3bc4c866d 100644 --- a/ace/config-aix-4.1.x.h +++ b/ace/config-aix-4.1.x.h @@ -91,6 +91,7 @@ #define ACE_HAS_GETRUSAGE // EYE assume it does for now. +#define ACE_LACKS_PTHREAD_THR_SIGSETMASK #define ACE_HAS_DCETHREADS #define ACE_PTHREADS_MAP diff --git a/ace/config-hpux-10.x.h b/ace/config-hpux-10.x.h index ce0578b38ed..7f054b37275 100644 --- a/ace/config-hpux-10.x.h +++ b/ace/config-hpux-10.x.h @@ -60,6 +60,7 @@ #define ACE_HAS_PTHREADS #define ACE_MT_SAFE #define ACE_HAS_SIGINFO_T +#define ACE_LACKS_PTHREAD_THR_SIGSETMASK #define ACE_HAS_SETKIND_NP #define ACE_LACKS_CONDATTR_PSHARED #define ACE_LACKS_SI_ADDR diff --git a/ace/config-mvs.h b/ace/config-mvs.h index d9f7577c58a..c2eb04ab54f 100644 --- a/ace/config-mvs.h +++ b/ace/config-mvs.h @@ -143,6 +143,9 @@ // Platform doesn't have <sys/param.h> #define ACE_LACKS_PARAM_H +// Platform lacks pthread_sigaction +#define ACE_LACKS_PTHREAD_THR_SIGSETMASK + // Platform doesn't have pthread_setsched() and friends. #define ACE_LACKS_SETSCHED diff --git a/ace/config-osf1-3.2.h b/ace/config-osf1-3.2.h index 2bb2ba7ee0a..13e627d3b7a 100644 --- a/ace/config-osf1-3.2.h +++ b/ace/config-osf1-3.2.h @@ -29,6 +29,7 @@ #define ACE_LACKS_THREAD_PROCESS_SCOPING // Platform has non-POSIX setkind and other functions. +#define ACE_LACKS_PTHREAD_THR_SIGSETMASK #define ACE_HAS_SETKIND_NP #define ACE_HAS_PTHREAD_T @@ -96,6 +97,7 @@ // Platform supports POSIX O_NONBLOCK semantics. #define ACE_HAS_POSIX_NONBLOCK +#define ACE_LACKS_PTHREAD_THR_SIGSETMASK // ACE supports POSIX Pthreads. #define ACE_HAS_DCETHREADS diff --git a/ace/config-sunos5.5-sunc++-4.1.h b/ace/config-sunos5.5-sunc++-4.1.h index fe4aaf374fe..cddd6e98604 100644 --- a/ace/config-sunos5.5-sunc++-4.1.h +++ b/ace/config-sunos5.5-sunc++-4.1.h @@ -11,7 +11,7 @@ // Note that SunC++ 4.1 fixes template bugs that prevented earlier // versions from supporting template typedefs correctly. -#define ACE_HAS_TEMPLATE_TYPEDEFS +// #define ACE_HAS_TEMPLATE_TYPEDEFS // Platform supports System V IPC (most versions of UNIX, but not Win32) #define ACE_HAS_SYSV_IPC diff --git a/apps/Gateway/Gateway/svc.conf b/apps/Gateway/Gateway/svc.conf index 8dfd56585b1..7ae8d4b0080 100644 --- a/apps/Gateway/Gateway/svc.conf +++ b/apps/Gateway/Gateway/svc.conf @@ -1,3 +1,3 @@ #static Svc_Manager "-d -p 2913" -dynamic Gateway Service_Object *./libGateway.so:_make_ACE_Gateway() active "-d -c cc_config -f rt_config" +dynamic Gateway Service_Object * ./libGateway:_make_ACE_Gateway() active "-d -c cc_config -f rt_config" diff --git a/apps/Gateway/Peer/svc.conf b/apps/Gateway/Peer/svc.conf index 0f663260445..3bd0cd55891 100644 --- a/apps/Gateway/Peer/svc.conf +++ b/apps/Gateway/Peer/svc.conf @@ -1,3 +1,3 @@ #static Svc_Manager "-d -p 291" -dynamic Peer1 Service_Object *.shobj/Gateway_Handler.so:_alloc_peerd() active "-p 10004" -#dynamic Peer2 Service_Object *.shobj/Gateway_Handler.so:_alloc_peerd() active "-p 10003" +dynamic Peer1 Service_Object *.shobj/Gateway_Handler:_alloc_peerd() active "-p 10004" +#dynamic Peer2 Service_Object *.shobj/Gateway_Handler:_alloc_peerd() active "-p 10003" diff --git a/examples/ASX/CCM_App/svc.conf b/examples/ASX/CCM_App/svc.conf index 4737cc6312e..b083976607e 100644 --- a/examples/ASX/CCM_App/svc.conf +++ b/examples/ASX/CCM_App/svc.conf @@ -1,12 +1,12 @@ static ACE_Service_Manager "-d -p 3911" -dynamic My_Task Service_Object *.shobj/CCM_App.so:make_task() "-p 3000" +dynamic My_Task Service_Object *.shobj/CCM_App:make_task() "-p 3000" -stream dynamic CCM_App STREAM *.shobj/CCM_App.so:make_stream() active +stream dynamic CCM_App STREAM *.shobj/CCM_App:make_stream() active { - dynamic Device_Adapter Module *.shobj/CCM_App.so:make_da() - dynamic Event_Analyzer Module *.shobj/CCM_App.so:make_ea() - dynamic Multicast_Router Module *.shobj/CCM_App.so:make_mr() "-p 3001" + dynamic Device_Adapter Module *.shobj/CCM_App:make_da() + dynamic Event_Analyzer Module *.shobj/CCM_App:make_ea() + dynamic Multicast_Router Module *.shobj/CCM_App:make_mr() "-p 3001" } stream CCM_App diff --git a/examples/Service_Configurator/IPC-tests/server/svc.conf b/examples/Service_Configurator/IPC-tests/server/svc.conf index 47092c3d030..10069128a12 100644 --- a/examples/Service_Configurator/IPC-tests/server/svc.conf +++ b/examples/Service_Configurator/IPC-tests/server/svc.conf @@ -1,16 +1,16 @@ # To configure different services, simply uncomment the appropriate lines in this file! #static ACE_Service_Manager "-d -p 3911" -dynamic Remote_Brdcast Service_Object * .shobj/Handle_Broadcast.so:remote_broadcast "-p 10001" -#dynamic Remote_Stream Service_Object * .shobj/Handle_R_Stream.so:remote_stream "-p 20002" -#dynamic Remote_Dgram Service_Object * .shobj/Handle_R_Dgram.so:remote_dgram "-p 15001" -#dynamic Timer_1 Service_Object * .shobj/Handle_Timeout.so:timer_1 "-d 5 -i 1 -a 100" -#dynamic Local_Stream Service_Object * .shobj/Handle_L_Stream.so:local_stream "-r /tmp/foo_stream" -#dynamic Local_Pipe Service_Object * .shobj/Handle_L_Pipe.so:local_pipe "-r /tmp/foo_pipe" -#dynamic Local_Fifo Service_Object * .shobj/Handle_L_FIFO.so:local_fifo "-r /tmp/foo_fifo" -#dynamic Local_Dgram Service_Object * .shobj/Handle_L_Dgram.so:local_dgram "-r /tmp/foo_dgram" -#dynamic Local_CODgram Service_Object * .shobj/Handle_L_CODgram.so:local_codgram "-r /tmp/foo_codgram" -#dynamic Local_Spipe Service_Object * .shobj/Handle_L_SPIPE.so:local_spipe "-r /tmp/foo_spipe" -#dynamic Remote_Thr_Stream Service_Object * .shobj/Handle_Thr_Stream.so:remote_thr_stream "-p 10001" +dynamic Remote_Brdcast Service_Object * .shobj/Handle_Broadcast:remote_broadcast "-p 10001" +#dynamic Remote_Stream Service_Object * .shobj/Handle_R_Stream:remote_stream "-p 20002" +#dynamic Remote_Dgram Service_Object * .shobj/Handle_R_Dgram:remote_dgram "-p 15001" +#dynamic Timer_1 Service_Object * .shobj/Handle_Timeout:timer_1 "-d 5 -i 1 -a 100" +#dynamic Local_Stream Service_Object * .shobj/Handle_L_Stream:local_stream "-r /tmp/foo_stream" +#dynamic Local_Pipe Service_Object * .shobj/Handle_L_Pipe:local_pipe "-r /tmp/foo_pipe" +#dynamic Local_Fifo Service_Object * .shobj/Handle_L_FIFO:local_fifo "-r /tmp/foo_fifo" +#dynamic Local_Dgram Service_Object * .shobj/Handle_L_Dgram:local_dgram "-r /tmp/foo_dgram" +#dynamic Local_CODgram Service_Object * .shobj/Handle_L_CODgram:local_codgram "-r /tmp/foo_codgram" +#dynamic Local_Spipe Service_Object * .shobj/Handle_L_SPIPE:local_spipe "-r /tmp/foo_spipe" +#dynamic Remote_Thr_Stream Service_Object * .shobj/Handle_Thr_Stream:remote_thr_stream "-p 10001" #suspend Remote_Stream #resume Local_SPIPE #resume Remote_Stream diff --git a/netsvcs/clients/Naming/Client/svc.conf b/netsvcs/clients/Naming/Client/svc.conf index 7625547e8d8..45831c1aae6 100644 --- a/netsvcs/clients/Naming/Client/svc.conf +++ b/netsvcs/clients/Naming/Client/svc.conf @@ -1,6 +1,6 @@ # Note that $DB and $PORT are environment variables that are # automatically interpreted and substituted by ACE! static ACE_Naming_Context "main -s $DB -p $PORT -h tango" -dynamic Name_Server_test Service_Object * ./libClient_Test.so:_make_Client_Test () +dynamic Name_Server_test Service_Object * ./libClient_Test:_make_Client_Test () # Note: Client_Test must come after ACE_Naming_Context since it relies # on the ACE_Naming_Context having been linked... diff --git a/netsvcs/servers/cli.conf b/netsvcs/servers/cli.conf index 875e445f813..b2d8fbc8194 100644 --- a/netsvcs/servers/cli.conf +++ b/netsvcs/servers/cli.conf @@ -1,11 +1,11 @@ # UNIX version # # These are the services that can be linked into ACE. -# Note that you can replace the hardcoded "../lib/libnet_svcs.so" with +# Note that you can replace the hardcoded "../lib/libnet_svcs" with # a relative path if you set your LD search path correctly -- ACE will # locate this for you automatically by reading your LD search path! # In addition, you can replace the hardcoded "-p 20xxx" with "-p # $PORTxxx" if you set your environment variables correctly. # Activate the Client Logging Daemon. -dynamic Client_Logging_Service Service_Object * ../lib/libnet_svcs.so:_make_ACE_Client_Logging_Connector() active "-p 20009 -h merengue" +dynamic Client_Logging_Service Service_Object * ../lib/libnet_svcs:_make_ACE_Client_Logging_Connector() active "-p 20009 -h merengue" diff --git a/netsvcs/servers/svc.conf b/netsvcs/servers/svc.conf index 8fdb837b6aa..f8634065b13 100644 --- a/netsvcs/servers/svc.conf +++ b/netsvcs/servers/svc.conf @@ -1,15 +1,17 @@ # These are the services that can be linked into ACE. -# Note that you can replace the hardcoded "../lib/libnet_svcs.so" with +# Note that you can replace the hardcoded "../lib/libnet_svcs" with # a relative path if you set your LD search path correctly -- ACE will -# locate this for you automatically by reading your LD search path! -# In addition, you can replace the hardcoded "-p 20xxx" with "-p -# $PORTxxx" if you set your environment variables correctly. +# locate this for you automatically by reading your LD search path. +# Moreover, ACE will automatically insert the correct suffix (e.g., +# ".dll", ".so", etc.). In addition, you can replace the hardcoded +# "-p 20xxx" with "-p $PORTxxx" if you set your environment variables +# correctly. -dynamic Logger Service_Object * ../lib/libnet_svcs.so:_make_ACE_Logger() "-s foobar -f STDERR|OSTREAM" -dynamic Time_Service Service_Object * ../lib/libnet_svcs.so:_make_ACE_TS_Server_Acceptor() "-p 10222" -dynamic Name_Server Service_Object * ../lib/libnet_svcs.so:_make_ACE_Name_Acceptor() "-p 10012" -dynamic Token_Service Service_Object * ../lib/libnet_svcs.so:_make_ACE_Token_Acceptor() "-p 10202" -dynamic Server_Logging_Service Service_Object * ../lib/libnet_svcs.so:_make_ACE_Server_Logging_Acceptor() active "-p 10009" -dynamic Thr_Server_Logging_Service Service_Object * ../lib/libnet_svcs.so:_make_ACE_Thr_Server_Logging_Acceptor() active "-p 10020" -dynamic Client_Logging_Service Service_Object * ../lib/libnet_svcs.so:_make_ACE_Client_Logging_Connector() active "-p 10009" +dynamic Logger Service_Object * ../lib/libnet_svcs:_make_ACE_Logger() "-s foobar -f STDERR|OSTREAM" +dynamic Time_Service Service_Object * ../lib/libnet_svcs:_make_ACE_TS_Server_Acceptor() "-p 10222" +dynamic Name_Server Service_Object * ../lib/libnet_svcs:_make_ACE_Name_Acceptor() "-p 10012" +dynamic Token_Service Service_Object * ../lib/libnet_svcs:_make_ACE_Token_Acceptor() "-p 10202" +dynamic Server_Logging_Service Service_Object * ../lib/libnet_svcs:_make_ACE_Server_Logging_Acceptor() active "-p 10009" +dynamic Thr_Server_Logging_Service Service_Object * ../lib/libnet_svcs:_make_ACE_Thr_Server_Logging_Acceptor() active "-p 10020" +dynamic Client_Logging_Service Service_Object * ../lib/libnet_svcs:_make_ACE_Client_Logging_Connector() active "-p 10009" diff --git a/performance-tests/Synch-Benchmarks/Options.cpp b/performance-tests/Synch-Benchmarks/Options.cpp index 4314dc5e834..ea416968ef4 100644 --- a/performance-tests/Synch-Benchmarks/Options.cpp +++ b/performance-tests/Synch-Benchmarks/Options.cpp @@ -3,7 +3,7 @@ #if defined (ACE_HAS_THREADS) -/* Manages the options */ +// Manages the options. Options options; size_t @@ -32,33 +32,33 @@ Options::init (void) } Options::Options (void) - : _debugging (0), - _verbosity (0), - _low_water_mark (1024), + : thr_wc_size (10000), + _service_entry (0), + _mapped_file (0), + _pipe_addr (ACE_DEFAULT_RENDEZVOUS), + _sleep_time (100), + _n_lwps (0), + _thr_count (4), + _t_flags (0), _high_water_mark (8 * 1024), + _low_water_mark (1024), _msg_size (128), - _thr_count (4), - _generate (0), _initial_queue_length (0), - _iterations (100000), - _t_flags (0), _logical_connections (1), _physical_connections (1), + _iterations (100000), + _generate (0), + _udp (0), + _debugging (0), + _verbosity (0), _ack (1), - thr_wc_size (10000), - _service_entry (0), - _mapped_file (0), - _pipe_addr ("/tmp/pipe"), _checksum (1), _xdr (1), - _sleep_time (100), - _n_lwps (0), _free_memory (1), _zero_copy (0), _print_summary (0), _consecutive_ports (1), - _eager_exit (0), - _udp (0) + _eager_exit (0) { this->thr_work_count = new int[this->thr_wc_size]; this->init (); diff --git a/performance-tests/Synch-Benchmarks/Options.h b/performance-tests/Synch-Benchmarks/Options.h index 7432f78f604..fccec81e3bd 100644 --- a/performance-tests/Synch-Benchmarks/Options.h +++ b/performance-tests/Synch-Benchmarks/Options.h @@ -1,7 +1,7 @@ /* -*- C++ -*- */ // $Id$ -/* Option manager for ustreams */ +// Option manager for performance tests. #if !defined (_OPTIONS_H) #define _OPTIONS_H @@ -84,41 +84,41 @@ public: int do_zero_copy (void); void print_results (void); - ACE_Atomic_Op<ACE_Thread_Mutex, size_t> msg_count; /* Keep track of number of messages atomically */ - int *thr_work_count; /* Count activity per-thread */ - int thr_wc_size; /* Max number of threads */ + ACE_Atomic_Op<ACE_Thread_Mutex, size_t> msg_count; // Keep track of number of messages atomically. + int *thr_work_count; // Count activity per-thread. + int thr_wc_size; // Max number of threads. private: - ACE_Profile_Timer _itimer; /* Keep track of time */ - char *_service_entry; /* Name of the shared object file and shared object */ - char *_mapped_file; /* Name of the mapped file */ - char *_pipe_addr; /* Name of the STREAM pipe */ - size_t _sleep_time; /* Time to sleep */ - size_t _n_lwps; /* Number of LWPs */ - size_t _thr_count; /* Number of threads to spawn */ - long _t_flags; /* Flags to thr_create() */ - size_t _high_water_mark; /* ACE_Queue high water mark */ - size_t _low_water_mark; /* ACE_Queue low water mark */ - size_t _msg_size; /* Size of a message */ - size_t _initial_queue_length; /* Initial number of items in the queue */ - size_t _logical_connections; /* Number of logical connections */ - size_t _physical_connections; /* Number of physical connections */ - size_t _iterations; /* Number of iterations to run the test program */ - int _generate; /* Generate the data */ - int _udp; /* Use UDP format */ - int _debugging; /* Extra debugging info */ - int _verbosity; /* Extra verbose messages */ - int _ack; /* Do an acknowledgement */ - int _checksum; /* Is checksumming enabled? */ - int _xdr; /* Is xdr conversion enabled? */ - int _free_memory; /* Are we freeing up memory? */ - int _zero_copy; /* Implement a zero-copy driver? */ - int _print_summary; /* Print a summary of the results only */ - int _consecutive_ports; /* Number of consecutive messages from same port */ - int _eager_exit; /* Exit eagerly, without cleaning up */ + ACE_Profile_Timer _itimer; // Keep track of time. + char *_service_entry; // Name of the shared object file and shared object. + char *_mapped_file; // Name of the mapped file. + char *_pipe_addr; // Name of the STREAM pipe. + size_t _sleep_time; // Time to sleep. + size_t _n_lwps; // Number of LWPs. + size_t _thr_count; // Number of threads to spawn. + long _t_flags; // Flags to thr_create(). + size_t _high_water_mark; // ACE_Queue high water mark. + size_t _low_water_mark; // ACE_Queue low water mark. + size_t _msg_size; // Size of a message. + size_t _initial_queue_length; // Initial number of items in the queue. + size_t _logical_connections; // Number of logical connections. + size_t _physical_connections; // Number of physical connections. + size_t _iterations; // Number of iterations to run the test program. + int _generate; // Generate the data. + int _udp; // Use UDP format. + int _debugging; // Extra debugging info. + int _verbosity; // Extra verbose messages. + int _ack; // Do an acknowledgement. + int _checksum; // Is checksumming enabled?. + int _xdr; // Is xdr conversion enabled?. + int _free_memory; // Are we freeing up memory?. + int _zero_copy; // Implement a zero-copy driver?. + int _print_summary; // Print a summary of the results only. + int _consecutive_ports; // Number of consecutive messages from same port. + int _eager_exit; // Exit eagerly, without cleaning up. }; -/* Make this available to any code that wants to see it! */ +// Make this available to any code that wants to see it! extern Options options; #include "Options.i" diff --git a/performance-tests/Synch-Benchmarks/pipe_thr_test.cpp b/performance-tests/Synch-Benchmarks/pipe_thr_test.cpp index 4813ed3e3c2..5bcc0712643 100644 --- a/performance-tests/Synch-Benchmarks/pipe_thr_test.cpp +++ b/performance-tests/Synch-Benchmarks/pipe_thr_test.cpp @@ -15,7 +15,7 @@ public: virtual int svc (void); private: - int pipe_fds[2]; + ACE_HANDLE pipe_handles[2]; static void *reader (Pipe_Thr_Test *); }; @@ -25,13 +25,14 @@ Pipe_Thr_Test::reader (Pipe_Thr_Test *t) { ACE_Thread_Control tc (ACE_Service_Config::thr_mgr ()); - int fd = t->pipe_fds[0]; - int ni = t->thr_id (); - int length = options.msg_size (); - char *to = new char[length]; - int n; + ACE_HANDLE handle = t->pipe_handles[0]; + int ni = t->thr_id (); + size_t length = options.msg_size (); + ssize_t n; + char *to; + ACE_NEW_RETURN (to, char[length], 0); - while ((n = ACE_OS::read (fd, to, length)) > 0) + while ((n = ACE_OS::read (handle, to, length)) > 0) options.thr_work_count[ni]++; return 0; @@ -42,7 +43,7 @@ Pipe_Thr_Test::init (int, char **) { synch_count = 1; - if (ACE_OS::pipe (this->pipe_fds) == -1) + if (ACE_OS::pipe (this->pipe_handles) == -1) ACE_OS::perror ("pipe"), ACE_OS::exit (1); if (ACE_Service_Config::thr_mgr ()->spawn @@ -57,15 +58,16 @@ int Pipe_Thr_Test::svc (void) { size_t length = options.msg_size (); - char *from = new char[length]; - int fd = this->pipe_fds[1]; + ACE_HANDLE handle = this->pipe_handles[1]; + char *from; + ACE_NEW_RETURN (from, char[length], -1); while (!this->done ()) - if (ACE_OS::write (fd, from, length) != length) + if (ACE_OS::write (handle, from, length) != length) ACE_OS::perror ("write"); - ACE_OS::close (this->pipe_fds[0]); - ACE_OS::close (this->pipe_fds[1]); + ACE_OS::close (this->pipe_handles[0]); + ACE_OS::close (this->pipe_handles[1]); return 0; } diff --git a/performance-tests/Synch-Benchmarks/synch_driver.cpp b/performance-tests/Synch-Benchmarks/synch_driver.cpp index e4412022e7a..738eb5acf6c 100644 --- a/performance-tests/Synch-Benchmarks/synch_driver.cpp +++ b/performance-tests/Synch-Benchmarks/synch_driver.cpp @@ -86,6 +86,7 @@ Benchmark_Test::run_test (void) // Initialize and run the benchmarks tests. +int Benchmark_Test::init (int argc, char **argv) { options.parse_args (argc, argv); diff --git a/tests/Mutex_Test.cpp b/tests/Mutex_Test.cpp index cbfe09cbc57..ed5181c1ba5 100644 --- a/tests/Mutex_Test.cpp +++ b/tests/Mutex_Test.cpp @@ -45,6 +45,7 @@ test (void *args) ACE_ASSERT (pm->release () == 0); ACE_DEBUG ((LM_DEBUG, "(%P|%t) = released\n")); } + return 0; } diff --git a/tests/Priority_Buffer_Test.cpp b/tests/Priority_Buffer_Test.cpp index 2cc7b85bc7d..21b22875ab5 100644 --- a/tests/Priority_Buffer_Test.cpp +++ b/tests/Priority_Buffer_Test.cpp @@ -40,7 +40,8 @@ static const long max_queue = LONG_MAX; static void * consumer (void *args) { - ACE_Message_Queue<ACE_MT_SYNCH> *msg_queue = (ACE_Message_Queue<ACE_MT_SYNCH>*) args; + ACE_Message_Queue<ACE_MT_SYNCH> *msg_queue = (ACE_Message_Queue<ACE_MT_SYNCH> *) args; + u_long cur_priority = 27; int local_count = 0; @@ -85,7 +86,7 @@ consumer (void *args) static void * producer (void *args) { - ACE_Message_Queue<ACE_MT_SYNCH> *msg_queue = (ACE_Message_Queue<ACE_MT_SYNCH>*) args; + ACE_Message_Queue<ACE_MT_SYNCH> *msg_queue = (ACE_Message_Queue<ACE_MT_SYNCH> *) args; // Insert thread into thr_mgr. ACE_Thread_Control thread_control (ACE_Service_Config::thr_mgr ()); |