diff options
author | Ossama Othman <ossama-othman@users.noreply.github.com> | 2000-06-15 19:51:43 +0000 |
---|---|---|
committer | Ossama Othman <ossama-othman@users.noreply.github.com> | 2000-06-15 19:51:43 +0000 |
commit | bdc797b98cabb5950e306cc60daeea081d8f9838 (patch) | |
tree | 56f08329868c254c8d868fab84343dc95d62bc42 /ace | |
parent | 2e1a154440bf7c6a6ce4546acb2155a26842fcc2 (diff) | |
download | ATCD-bdc797b98cabb5950e306cc60daeea081d8f9838.tar.gz |
ChangeLogTag:Thu Jun 15 12:49:50 2000 Ossama Othman <ossama@uci.edu>
Diffstat (limited to 'ace')
-rw-r--r-- | ace/Malloc_T.cpp | 25 | ||||
-rw-r--r-- | ace/OS.h | 15 | ||||
-rw-r--r-- | ace/Process_Manager.cpp | 42 | ||||
-rw-r--r-- | ace/Service_Repository.cpp | 25 | ||||
-rw-r--r-- | ace/Thread_Manager.cpp | 12 | ||||
-rw-r--r-- | ace/config-linux-lxpthreads.h | 29 |
6 files changed, 57 insertions, 91 deletions
diff --git a/ace/Malloc_T.cpp b/ace/Malloc_T.cpp index 4633c6fa5a3..1c245f7d407 100644 --- a/ace/Malloc_T.cpp +++ b/ace/Malloc_T.cpp @@ -568,12 +568,10 @@ ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::trybind (const char *name, if (node == 0) // Didn't find it, so insert it. return this->shared_bind (name, pointer); - else - { - // Found it, so return a copy of the current entry. - pointer = (char *) node->pointer_; - return 1; - } + + // Found it, so return a copy of the current entry. + pointer = (char *) node->pointer_; + return 1; } template <ACE_MEM_POOL_1, class ACE_LOCK, class ACE_CB> int @@ -588,11 +586,10 @@ ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::bind (const char *name, // If we're not allowing duplicates, then if the name is already // present, return 1. return 1; - else - // If we get this far, either we're allowing duplicates or we didn't - // find the name yet. - return this->shared_bind (name, pointer); + // If we get this far, either we're allowing duplicates or we didn't + // find the name yet. + return this->shared_bind (name, pointer); } template <ACE_MEM_POOL_1, class ACE_LOCK, class ACE_CB> int @@ -607,11 +604,9 @@ ACE_Malloc_T<ACE_MEM_POOL_2, ACE_LOCK, ACE_CB>::find (const char *name, if (node == 0) return -1; - else - { - pointer = (char *) node->pointer_; - return 0; - } + + pointer = (char *) node->pointer_; + return 0; } // Returns a count of the number of available chunks that can hold @@ -1784,6 +1784,9 @@ struct stat # endif /* ! ACE_HAS_EXCEPTIONS */ #endif /*ACE_HAS_NO_THROW_SPEC*/ +#if !defined (ACE_LACKS_UNISTD_H) +# include /**/ <unistd.h> +#endif /* ACE_LACKS_UNISTD_H */ #if defined (ACE_HAS_PRIOCNTL) // Need to #include thread.h before #defining THR_BOUND, etc., @@ -1842,8 +1845,8 @@ struct stat // programs to have their own ACE-wide "default". // PROCESS-level values -// MM-Graz: added unixware 7.1 -# if !defined(_UNICOS) && !defined(UNIXWARE_7_1) +# if defined (_POSIX_PRIORITY_SCHEDULING) && \ + !defined(_UNICOS) && !defined(UNIXWARE_7_1) # define ACE_PROC_PRI_FIFO_MIN (sched_get_priority_min(SCHED_FIFO)) # define ACE_PROC_PRI_RR_MIN (sched_get_priority_min(SCHED_RR)) # define ACE_PROC_PRI_OTHER_MIN (sched_get_priority_min(SCHED_OTHER)) @@ -1853,8 +1856,8 @@ struct stat # define ACE_PROC_PRI_RR_MIN 0 # define ACE_PROC_PRI_OTHER_MIN 0 # endif -// MM-Graz: added unixware 7.1 -# if !defined(UNIXWARE_7_1) + +# if defined (_POSIX_PRIORITY_SCHEDULING) && !defined(UNIXWARE_7_1) # define ACE_PROC_PRI_FIFO_MAX (sched_get_priority_max(SCHED_FIFO)) # define ACE_PROC_PRI_RR_MAX (sched_get_priority_max(SCHED_RR)) # define ACE_PROC_PRI_OTHER_MAX (sched_get_priority_max(SCHED_OTHER)) @@ -3562,10 +3565,6 @@ typedef void (*__sighandler_t)(int); // keep Signal compilation happy # endif /* ! __QNX__ */ # endif /* ACE_HAS_TERM_IOCTLS */ -# if !defined (ACE_LACKS_UNISTD_H) -# include /**/ <unistd.h> -# endif /* ACE_LACKS_UNISTD_H */ - # if defined (ACE_HAS_AIO_CALLS) # include /**/ <aio.h> # endif /* ACE_HAS_AIO_CALLS */ diff --git a/ace/Process_Manager.cpp b/ace/Process_Manager.cpp index 32804e2ca96..a50b98fd8b9 100644 --- a/ace/Process_Manager.cpp +++ b/ace/Process_Manager.cpp @@ -415,17 +415,15 @@ ACE_Process_Manager::register_handler (ACE_Event_Handler *eh, if (i == -1) // set "process not found" error return -1; - else - { - ACE_Process_Descriptor &proc_desc = this->process_table_[i]; - if (proc_desc.exit_notify_ != 0) - proc_desc.exit_notify_->handle_close - (ACE_INVALID_HANDLE, - 0); - proc_desc.exit_notify_ = eh; - return 0; - } + ACE_Process_Descriptor &proc_desc = this->process_table_[i]; + + if (proc_desc.exit_notify_ != 0) + proc_desc.exit_notify_->handle_close + (ACE_INVALID_HANDLE, + 0); + proc_desc.exit_notify_ = eh; + return 0; } int @@ -473,17 +471,15 @@ ACE_Process_Manager::spawn (ACE_Process *process, if (pid == ACE_INVALID_PID || pid == 0) return pid; - else - { - ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, - ace_mon, this->lock_, -1)); - if (this->append_proc (process) == -1) - // bad news: spawned, but not registered in table. - return ACE_INVALID_PID; - else - return pid; - } + ACE_MT (ACE_GUARD_RETURN (ACE_Thread_Mutex, + ace_mon, this->lock_, -1)); + + if (this->append_proc (process) == -1) + // bad news: spawned, but not registered in table. + return ACE_INVALID_PID; + + return pid; } // Create N new processs. @@ -582,9 +578,9 @@ ACE_Process_Manager::remove (pid_t pid) if (i != -1) return this->remove_proc (i); - else - // set "process not found" error - return -1; + + // set "process not found" error + return -1; } // Remove a process from the pool. Must be called with locks held. diff --git a/ace/Service_Repository.cpp b/ace/Service_Repository.cpp index 25b35e692f9..198ac3c6830 100644 --- a/ace/Service_Repository.cpp +++ b/ace/Service_Repository.cpp @@ -276,8 +276,8 @@ ACE_Service_Repository::insert (const ACE_Service_Type *sr) this->current_size_++; return 0; } - else - return -1; + + return -1; } // Re-resume a service that was previously suspended. @@ -332,19 +332,18 @@ ACE_Service_Repository::remove (const ACE_TCHAR name[]) if (i == -1) return -1; - else - { - ACE_Service_Type *s = ACE_const_cast (ACE_Service_Type *, - this->service_vector_[i]); - delete s; - --this->current_size_; + ACE_Service_Type *s = ACE_const_cast (ACE_Service_Type *, + this->service_vector_[i]); + delete s; - if (this->current_size_ >= 1) - this->service_vector_[i] - = this->service_vector_[this->current_size_]; - return 0; - } + --this->current_size_; + + if (this->current_size_ >= 1) + this->service_vector_[i] + = this->service_vector_[this->current_size_]; + + return 0; } ACE_ALLOC_HOOK_DEFINE(ACE_Service_Repository_Iterator) diff --git a/ace/Thread_Manager.cpp b/ace/Thread_Manager.cpp index f08364443da..06ed0d7a4c2 100644 --- a/ace/Thread_Manager.cpp +++ b/ace/Thread_Manager.cpp @@ -738,8 +738,8 @@ ACE_Thread_Manager::spawn (ACE_THR_FUNC func, if (this->spawn_i (func, args, flags, t_id, t_handle, priority, grp_id, stack, stack_size) == -1) return -1; - else - return grp_id; + + return grp_id; } // Create N new threads running FUNC. @@ -923,8 +923,8 @@ ACE_Thread_Manager::insert_thr (ACE_thread_t t_id, 0, flags) == -1) return -1; - else - return grp_id; + + return grp_id; } // Run the registered hooks when the thread exits. @@ -1228,8 +1228,8 @@ ACE_Thread_Manager::check_state (ACE_UINT32 state, } if (enable) return ACE_BIT_ENABLED (thr_state, state); - else - return ACE_BIT_DISABLED (thr_state, state); + + return ACE_BIT_DISABLED (thr_state, state); } // Test if a single thread is suspended. diff --git a/ace/config-linux-lxpthreads.h b/ace/config-linux-lxpthreads.h index e76bb53315d..67dc61fac7f 100644 --- a/ace/config-linux-lxpthreads.h +++ b/ace/config-linux-lxpthreads.h @@ -6,24 +6,7 @@ more information you should check out his Web site: http://pauillac.inria.fr/~xleroy/linuxthreads/ - - The version I have installed and working is an RPM* - based on Xavier's 0.5 release. I don't know where - the tarball of 0.5 can be found, but I suspect that - Xavier's site has it... - - * RPM == Redhat Package Management - - My system is a Caldera-based distribution with many upgraded - packages. If you don't use RPM, there is a program (rpm2cpio) - which will extract the files for "normal consumption". - - You may also want to check out the "ACE On Linux" pages at: - - http://users.deltanet.com/users/slg/ACE/ - - (They were a little out of date when I last was there - however.) */ +*/ #ifndef ACE_CONFIG_H #define ACE_CONFIG_H @@ -36,21 +19,15 @@ // Yes, we do have threads. #define ACE_HAS_THREADS -// And they're even POSIX pthreads (MIT implementation) +// And they're even POSIX pthreads (LinuxThreads implementation) #define ACE_HAS_PTHREADS // ... and the final standard even! #define ACE_HAS_PTHREADS_STD #if !defined (ACE_MT_SAFE) - #define ACE_MT_SAFE 1 // JCEJ 12/22/96 #1 +#define ACE_MT_SAFE 1 // JCEJ 12/22/96 #1 #endif #define ACE_HAS_THREAD_SPECIFIC_STORAGE // jcej 12/22/96 #2 -#define PTHREAD_MIN_PRIORITY 0 // JCEJ 12/22/96 #3 -#if !defined(ACE_LACKS_PTHREAD_SIGMASK) -# define PTHREAD_MAX_PRIORITY 99 // CJC 02/11/97 -#else -# define PTHREAD_MAX_PRIORITY 32 // JCEJ 12/22/96 #3 -#endif #define ACE_LACKS_THREAD_STACK_ADDR // JCEJ 12/17/96 #define ACE_LACKS_THREAD_STACK_SIZE // JCEJ 12/17/96 |