summaryrefslogtreecommitdiff
path: root/ace
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1997-12-05 23:29:39 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1997-12-05 23:29:39 +0000
commitb64537275f7a2f65888f3e7def08b39bf87afbdb (patch)
treedd88f510132813dda4aff0c2c1d25aa4f972589c /ace
parentab11a5258bb8a032f85e01571e7fe5485b2b5144 (diff)
downloadATCD-b64537275f7a2f65888f3e7def08b39bf87afbdb.tar.gz
*** empty log message ***
Diffstat (limited to 'ace')
-rw-r--r--ace/ACE.cpp17
-rw-r--r--ace/ACE.h18
-rw-r--r--ace/Acceptor.cpp8
-rw-r--r--ace/Acceptor.h2
-rw-r--r--ace/Addr.cpp3
-rw-r--r--ace/Addr.h11
-rw-r--r--ace/Connector.h14
-rw-r--r--ace/Hash_Map_Manager.cpp5
-rw-r--r--ace/Task.h20
-rw-r--r--ace/Thread_Manager.h60
10 files changed, 98 insertions, 60 deletions
diff --git a/ace/ACE.cpp b/ace/ACE.cpp
index 7bcaeb23de8..e8e3e674c68 100644
--- a/ace/ACE.cpp
+++ b/ace/ACE.cpp
@@ -347,7 +347,9 @@ ACE::crc32 (const char *string)
u_long len = 0;
- for (const char *p = string; *p != 0; ++p)
+ for (const char *p = string;
+ *p != 0;
+ ++p)
{
COMPUTE (crc, *p);
++len;
@@ -361,8 +363,6 @@ ACE::crc32 (const char *string)
return ~crc;
}
-//****************************************************************
-
size_t
ACE::strrepl (char *s, char search, char replace)
{
@@ -741,11 +741,14 @@ ACE::send_n (ACE_HANDLE handle,
size_t bytes_written;
ssize_t n = 0;
- for (bytes_written = 0; bytes_written < len; bytes_written += n)
+ for (bytes_written = 0;
+ bytes_written < len;
+ bytes_written += n)
{
- n = ACE_OS::send (handle, (const char *) buf + bytes_written,
- len - bytes_written, flags);
-
+ n = ACE_OS::send (handle,
+ (const char *) buf + bytes_written,
+ len - bytes_written,
+ flags);
if (n == -1)
{
if (errno != EWOULDBLOCK)
diff --git a/ace/ACE.h b/ace/ACE.h
index 06be9e26f8d..50e50c1bc5f 100644
--- a/ace/ACE.h
+++ b/ace/ACE.h
@@ -42,13 +42,13 @@ class ACE_Export ACE
public:
// = ACE version information.
- static u_int major_version ();
+ static u_int major_version (void);
// E.g., the "4" in ACE 4.3.19.
- static u_int minor_version ();
+ static u_int minor_version (void);
// E.g., the "3" in ACE 4.3.19.
- static u_int beta_version ();
+ static u_int beta_version (void);
// E.g., the "19" in ACE 4.3.19. Returns 0 for "stable" (non-beta) releases.
// = Recv operations that factor out differences between Win32 and UNIX.
@@ -413,15 +413,18 @@ public:
// otherwise returns a dynamically allocated buffer containing
// "<pathname>.exe". Always returns <pathname> on UNIX.
- static const char *basename (const char *pathname, char delim);
+ static const char *basename (const char *pathname,
+ char delim);
// Returns the "basename" of a <pathname>.
#if defined (ACE_HAS_UNICODE)
- static const wchar_t *basename (const wchar_t *pathname, wchar_t delim);
+ static const wchar_t *basename (const wchar_t *pathname,
+ wchar_t delim);
// Returns the "basename" of a <pathname>.
#endif /* ACE_HAS_UNICODE */
- static char *timestamp (char date_and_time[], int time_len);
+ static char *timestamp (char date_and_time[],
+ int time_len);
// Returns the current timestamp in the form
// "hour:minute:second:microsecond." The month, day, and year are
// also stored in the beginning of the date_and_time array. Returns
@@ -446,7 +449,8 @@ public:
// apply the appropriate prefix (e.g., "lib" on UNIX and "" on
// Win32) if the <filename> doesn't match directly.
- static FILE *ldopen (const char *filename, const char *type);
+ static FILE *ldopen (const char *filename,
+ const char *type);
// Uses <ldopen> to locate and open the appropriate <filename> and
// returns a pointer to the file, else it returns a NULL
// pointer. <type> specifies how the file should be open.
diff --git a/ace/Acceptor.cpp b/ace/Acceptor.cpp
index 53297383d74..b46916232b9 100644
--- a/ace/Acceptor.cpp
+++ b/ace/Acceptor.cpp
@@ -183,7 +183,8 @@ ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::handle_close (ACE_HANDLE,
// accept_strategy_...
this->reactor_->remove_handler
- (handle, ACE_Event_Handler::ACCEPT_MASK | ACE_Event_Handler::DONT_CALL);
+ (handle,
+ ACE_Event_Handler::ACCEPT_MASK | ACE_Event_Handler::DONT_CALL);
// Shut down the listen socket to recycle the handles.
if (this->peer_acceptor_.close () == -1)
@@ -294,7 +295,7 @@ ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::handle_input (ACE_HANDLE listene
// Default is "timeout (0, 0)," which means "poll."
ACE_Time_Value timeout;
- // Accept connections from clients (note that a loop is used for two
+ // Accept connections from clients. Note that a loop is used for two
// reasons:
//
// 1. It allows us to accept all pending connections without an
@@ -302,7 +303,7 @@ ACE_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::handle_input (ACE_HANDLE listene
// non-blocking I/O...
//
// 2. It allows the TLI_SAP::ACE_Acceptor class to work correctly (don't
- // ask -- TLI is *horrible*...)).
+ // ask -- TLI is *horrible*...).
// @@ What should we do if any of the substrategies fail? Right
// now, we just log an error message and return 0 (which means that
@@ -646,6 +647,7 @@ ACE_Strategy_Acceptor<SVC_HANDLER, ACE_PEER_ACCEPTOR_2>::info (char **strp,
size_t length) const
{
ACE_TRACE ("ACE_Strategy_Acceptor::info");
+
char buf[BUFSIZ];
char service_addr_str[BUFSIZ];
ACE_PEER_ACCEPTOR_ADDR addr;
diff --git a/ace/Acceptor.h b/ace/Acceptor.h
index 6c62f1c1a24..123aead77a8 100644
--- a/ace/Acceptor.h
+++ b/ace/Acceptor.h
@@ -52,7 +52,7 @@ public:
// "Do-nothing" constructor.
ACE_Acceptor (const ACE_PEER_ACCEPTOR_ADDR &local_addr,
- ACE_Reactor * = ACE_Reactor::instance(),
+ ACE_Reactor * = ACE_Reactor::instance (),
int flags = 0);
// Initialize and register <this> with the Reactor and listen for
// connection requests at the designated <local_addr>. <flags>
diff --git a/ace/Addr.cpp b/ace/Addr.cpp
index e191f9caf4d..026eaa2f209 100644
--- a/ace/Addr.cpp
+++ b/ace/Addr.cpp
@@ -10,7 +10,8 @@
// This is a static class variable.
const ACE_Addr ace_sap_any (AF_ANY, -1);
-const ACE_Addr ACE_Addr::sap_any (void)
+const ACE_Addr &
+ACE_Addr::sap_any (void)
{
return ace_sap_any;
}
diff --git a/ace/Addr.h b/ace/Addr.h
index 331c4a4251f..732910527e6 100644
--- a/ace/Addr.h
+++ b/ace/Addr.h
@@ -27,7 +27,8 @@ class ACE_Export ACE_Addr
public:
// = Initialization method.
- ACE_Addr (int type = -1, int size = -1);
+ ACE_Addr (int type = -1,
+ int size = -1);
// Initializes instance variables.
// = Get/set the size of the address.
@@ -49,7 +50,8 @@ public:
virtual void *get_addr (void) const;
// Return a pointer to the address.
- virtual void set_addr (void *, int len);
+ virtual void set_addr (void *,
+ int len);
// Set a pointer to the address.
// = Equality/inequality tests
@@ -59,11 +61,12 @@ public:
int operator != (const ACE_Addr &sap) const;
// Check for address inequality.
- void base_set (int type, int size);
+ void base_set (int type,
+ int size);
// Initializes instance variables.
#if defined (ACE_HAS_BROKEN_SAP_ANY)
- static const ACE_Addr sap_any (void);
+ static const ACE_Addr &sap_any (void);
// Wild-card address.
// This #define works around broken C++ compilers...
diff --git a/ace/Connector.h b/ace/Connector.h
index 1532004d78e..21a833bcab2 100644
--- a/ace/Connector.h
+++ b/ace/Connector.h
@@ -371,11 +371,15 @@ protected:
// <SVC_HANDLER> as an "active object" via multi-threading or
// multi-processing).
- // = Define some useful typedefs.
- typedef ACE_Creation_Strategy<SVC_HANDLER> CREATION_STRATEGY;
- typedef ACE_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2> CONNECT_STRATEGY;
- typedef ACE_Concurrency_Strategy<SVC_HANDLER> CONCURRENCY_STRATEGY;
- typedef ACE_Connector <SVC_HANDLER, ACE_PEER_CONNECTOR_2> SUPER;
+ // = Define some useful typedefs traits.
+ typedef ACE_Creation_Strategy<SVC_HANDLER>
+ CREATION_STRATEGY;
+ typedef ACE_Connect_Strategy<SVC_HANDLER, ACE_PEER_CONNECTOR_2>
+ CONNECT_STRATEGY;
+ typedef ACE_Concurrency_Strategy<SVC_HANDLER>
+ CONCURRENCY_STRATEGY;
+ typedef ACE_Connector <SVC_HANDLER, ACE_PEER_CONNECTOR_2>
+ SUPER;
// = Strategy objects.
diff --git a/ace/Hash_Map_Manager.cpp b/ace/Hash_Map_Manager.cpp
index 247b4cca8ca..189f8ea182c 100644
--- a/ace/Hash_Map_Manager.cpp
+++ b/ace/Hash_Map_Manager.cpp
@@ -149,8 +149,9 @@ ACE_Hash_Map_Manager<EXT_ID, INT_ID, ACE_LOCK>::close_i (void)
hold_ptr->ACE_Hash_Map_Entry<EXT_ID, INT_ID>::~ACE_Hash_Map_Entry ();
this->allocator_->free (hold_ptr);
}
- // Now deal with the sentinal
- // Explicitly call the destructor.
+
+ // Now deal with the sentinel by explicitly calling the
+ // destructor.
table_[i].ACE_Hash_Map_Entry<EXT_ID, INT_ID>::~ACE_Hash_Map_Entry ();
}
diff --git a/ace/Task.h b/ace/Task.h
index 499cdf757bf..4e1cab43b08 100644
--- a/ace/Task.h
+++ b/ace/Task.h
@@ -111,15 +111,15 @@ public:
// THR_SCHED_RR, THR_SCHED_DEFAULT
// = END<INDENT>
//
- // By default, or if <{priority}> is set to ACE_DEFAULT_THREAD_PRIORITY,
- // an "appropriate"
- // priority value for the given scheduling policy (specified in
- // <{flags}>, e.g., <THR_SCHED_DEFAULT>) is used. This value is
- // calculated dynamically, and is the median value between the
- // minimum and maximum priority values for the given policy. If an
- // explicit value is given, it is used. Note that actual priority
- // values are EXTREMEMLY implementation-dependent, and are probably
- // best avoided.
+ // By default, or if <{priority}> is set to
+ // ACE_DEFAULT_THREAD_PRIORITY, an "appropriate" priority value for
+ // the given scheduling policy (specified in <{flags}>, e.g.,
+ // <THR_SCHED_DEFAULT>) is used. This value is calculated
+ // dynamically, and is the median value between the minimum and
+ // maximum priority values for the given policy. If an explicit
+ // value is given, it is used. Note that actual priority values are
+ // EXTREMEMLY implementation-dependent, and are probably best
+ // avoided.
//
// If <thread_handles> != 0 it is assumed to be an array of <n>
// thread_handles that will be assigned the values of the thread
@@ -161,8 +161,8 @@ public:
// Atomically decrement the thread count by 1. This should only be
// called by the <ACE_Task_Exit> class destructor.
- // Routine that runs the service routine as a daemon thread.
static void *svc_run (void *);
+ // Routine that runs the service routine as a daemon thread.
static void cleanup (void *object, void *params);
// Cleanup hook that is called when a thread exits to gracefully
diff --git a/ace/Thread_Manager.h b/ace/Thread_Manager.h
index a1ed03a9e9d..5515b803fcf 100644
--- a/ace/Thread_Manager.h
+++ b/ace/Thread_Manager.h
@@ -213,7 +213,8 @@ public:
// -1 on failure (<errno> will explain...), otherwise returns the
// group id of the threads.
- void *exit (void *status, int do_thread_exit = 1);
+ void *exit (void *status,
+ int do_thread_exit = 1);
// Called to clean up when a thread exits. If <do_thread_exit> is
// non-0 then <ACE_Thread::exit> is called to exit the thread, in
// which case <status> is passed as the exit value of the thread.
@@ -290,9 +291,11 @@ public:
// = Kill methods, send signals -- which isn't supported on Win32 (will not block).
int kill_all (int signum);
// Send signum to all stopped threads
- int kill (ACE_thread_t, int signum);
+ int kill (ACE_thread_t,
+ int signum);
// Kill a single thread.
- int kill_grp (int grp_id, int signum);
+ int kill_grp (int grp_id,
+ int signum);
// Kill a group of threads.
// = Cancel methods, which provides a cooperative thread-termination mechanism (will not block).
@@ -306,8 +309,10 @@ public:
// True if <t_id> is cancelled, else false.
// = Set/get group ids for a particular thread id.
- int set_grp (ACE_thread_t, int grp_id);
- int get_grp (ACE_thread_t, int &grp_id);
+ int set_grp (ACE_thread_t,
+ int grp_id);
+ int get_grp (ACE_thread_t,
+ int &grp_id);
// = The following methods are new methods which resemble current
// methods in <ACE_Thread Manager>. For example, the <apply_task>
@@ -322,7 +327,8 @@ public:
// Suspend all threads in an ACE_Task.
int resume_task (ACE_Task_Base *task);
// Resume all threads in an ACE_Task.
- int kill_task (ACE_Task_Base *task, int signum);
+ int kill_task (ACE_Task_Base *task,
+ int signum);
// Kill all threads in an ACE_Task.
int cancel_task (ACE_Task_Base *task);
// Cancel all threads in an ACE_Task.
@@ -376,8 +382,8 @@ public:
int acquire_release (void);
// Do nothing but to acquire the thread manager's lock and release.
// This is used mainly to get newly spawned thread in synch with
- // thread manager and prevent it from accessing it thread descriptor
- // before it gets fully built.
+ // thread manager and prevent it from accessing its thread
+ // descriptor before it gets fully built.
void wait_on_exit (int dowait);
int wait_on_exit (void);
@@ -414,7 +420,8 @@ protected:
// Locate the index of the table slot occupied by <h_id>. Returns
// -1 if <h_id> is not in the table doesn't contain <h_id>.
- ACE_Thread_Descriptor *find_task (ACE_Task_Base *task, int index = -1);
+ ACE_Thread_Descriptor *find_task (ACE_Task_Base *task,
+ int index = -1);
// Locate the thread descriptor address of the list occupied by
// <task>. Returns 0 if <task> is not in the table doesn't contain
// <task>.
@@ -434,7 +441,8 @@ protected:
// Append a thread in the table (adds at the end, growing the table
// if necessary).
- void remove_thr (ACE_Thread_Descriptor *td, int close_handler);
+ void remove_thr (ACE_Thread_Descriptor *td,
+ int close_handler);
// Remove thread from the table.
void remove_thr_all (void);
@@ -443,33 +451,44 @@ protected:
// = The following four methods implement a simple scheme for
// operating on a collection of threads atomically.
- int check_state (ACE_Thread_State state, ACE_thread_t thread);
+ int check_state (ACE_Thread_State state,
+ ACE_thread_t thread);
// Efficiently check whether <thread> is in a particular <state>.
// This call updates the TSS cache if possible to speed up
// subsequent searches.
- int apply_task (ACE_Task_Base *task, ACE_THR_MEMBER_FUNC, int = 0);
+ int apply_task (ACE_Task_Base *task,
+ ACE_THR_MEMBER_FUNC,
+ int = 0);
// Apply <func> to all members of the table that match the <task>
- int apply_grp (int grp_id, ACE_THR_MEMBER_FUNC func, int arg = 0);
+ int apply_grp (int grp_id,
+ ACE_THR_MEMBER_FUNC func,
+ int arg = 0);
// Apply <func> to all members of the table that match the <grp_id>.
- int apply_all (ACE_THR_MEMBER_FUNC, int = 0);
+ int apply_all (ACE_THR_MEMBER_FUNC,
+ int = 0);
// Apply <func> to all members of the table.
- int join_thr (ACE_Thread_Descriptor *td, int microsoft_sucks = 0);
+ int join_thr (ACE_Thread_Descriptor *td,
+ int = 0);
// Join the thread described in <tda>.
- int resume_thr (ACE_Thread_Descriptor *td, int microsoft_sucks = 0);
+ int resume_thr (ACE_Thread_Descriptor *td,
+ int = 0);
// Resume the thread described in <tda>.
- int suspend_thr (ACE_Thread_Descriptor *td, int microsoft_sucks = 0);
+ int suspend_thr (ACE_Thread_Descriptor *td,
+ int = 0);
// Suspend the thread described in <tda>.
- int kill_thr (ACE_Thread_Descriptor *td, int signum);
+ int kill_thr (ACE_Thread_Descriptor *td,
+ int signum);
// Send signal <signum> to the thread described in <tda>.
- int cancel_thr (ACE_Thread_Descriptor *td, int microsoft_sucks = 0);
+ int cancel_thr (ACE_Thread_Descriptor *td,
+ int = 0);
// Set the cancellation flag for the thread described in <tda>.
ACE_Double_Linked_List<ACE_Thread_Descriptor> thr_list_;
@@ -536,7 +555,8 @@ public:
// Remove the thread from its associated <Thread_Manager> and exit
// the thread if <do_thr_exit> is enabled.
- void *exit (void *status, int do_thr_exit);
+ void *exit (void *status,
+ int do_thr_exit);
// Remove this thread from its associated <Thread_Manager> and exit
// the thread if <do_thr_exit> is enabled.