summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1996-11-04 21:36:10 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1996-11-04 21:36:10 +0000
commitd2d1bff478dd70e128aaa5b0522d2e05c19d740d (patch)
treea32489842d9f8cec42fbded14bddc638eaa8bf4d
parent505aef66e1b6b12b47b1c88df0ae61aaf2fe6c21 (diff)
downloadATCD-d2d1bff478dd70e128aaa5b0522d2e05c19d740d.tar.gz
Foo
-rw-r--r--ace/CORBA_Handler.cpp13
-rw-r--r--ace/Log_Msg.cpp13
-rw-r--r--ace/OS.h2
-rw-r--r--ace/Reactor.cpp3
-rw-r--r--ace/Thread.i10
-rw-r--r--ace/Token.h6
6 files changed, 33 insertions, 14 deletions
diff --git a/ace/CORBA_Handler.cpp b/ace/CORBA_Handler.cpp
index bd0fde609c4..2c91d534caa 100644
--- a/ace/CORBA_Handler.cpp
+++ b/ace/CORBA_Handler.cpp
@@ -442,6 +442,19 @@ ACE_MT_CORBA_Handler::process_events (void *)
{
ACE_TRACE ("ACE_MT_CORBA_Handler::process_events");
+ // Special knowlege, we "know" that we are dealing with a singleton
+ // and that we are invoked in a context where the mutex controlling
+ // instance creation is held, so by the time we get the mutex
+ // the instance must exist.
+ if (ACE_MT_CORBA_Handler::instance_ == 0)
+ {
+ ACE_GUARD_RETURN (ACE_Thread_Mutex,
+ ace_mon,
+ ace_mt_corba_handler_lock_,
+ 0);
+ ACE_ASSERT (ACE_MT_CORBA_Handler::instance_ != 0);
+ }
+
ACE_Thread_Control t (ACE_MT_CORBA_Handler::instance_->thr_mgr ());
// This thread only processes events.
diff --git a/ace/Log_Msg.cpp b/ace/Log_Msg.cpp
index 7c713ca9040..d3333bd6ede 100644
--- a/ace/Log_Msg.cpp
+++ b/ace/Log_Msg.cpp
@@ -353,6 +353,12 @@ ACE_Log_Msg::log (const char *format_str,
extern int sys_nerr;
typedef void (*PTF)(...);
+ // Only print the message if <priority_mask_> hasn't been reset to
+ // exclude this logging priority.
+
+ if (ACE_BIT_DISABLED (this->priority_mask_, log_priority))
+ return 0;
+
ACE_Log_Record log_record (log_priority,
ACE_OS::time ((time_t *) 0),
this->getpid ());
@@ -583,11 +589,8 @@ ACE_Log_Msg::log (const char *format_str,
ACE_OS::free (ACE_MALLOC_T (save_p));
- // Only print the message if "SILENT" mode is disabled and the
- // <priority_mask_> hasn't been reset to exclude this logging
- // priority.
- if (ACE_BIT_ENABLED (ACE_Log_Msg::flags_, ACE_Log_Msg::SILENT) == 0
- && ACE_BIT_ENABLED (this->priority_mask_, log_priority))
+ // Only print the message if "SILENT" mode is disabled.
+ if (ACE_BIT_DISABLED (ACE_Log_Msg::flags_, ACE_Log_Msg::SILENT))
{
// Copy the message from thread-specific storage into the
// transfer buffer (this can be optimized away by changing other
diff --git a/ace/OS.h b/ace/OS.h
index 4ffdc40f59e..fe0e9a401b9 100644
--- a/ace/OS.h
+++ b/ace/OS.h
@@ -503,7 +503,6 @@ typedef struct
} ACE_sema_t;
#endif /* ACE_HAS_POSIX_SEM */
-#if !defined (PTHREAD_CANCEL_ENABLE)
struct cancel_state
{
int cancelstate;
@@ -513,7 +512,6 @@ struct cancel_state
int canceltype;
// e.g., PTHREAD_CANCEL_DEFERRED and PTHREAD_CANCEL_ASYNCHRONOUS.
};
-#endif /* PTHREAD_CANCEL_ENABLE */
#if defined (ACE_HAS_THREADS)
#if defined (ACE_HAS_STHREADS)
diff --git a/ace/Reactor.cpp b/ace/Reactor.cpp
index 7dd6e141083..b0a618b7f25 100644
--- a/ace/Reactor.cpp
+++ b/ace/Reactor.cpp
@@ -551,7 +551,8 @@ ACE_Notification_Handler::open (ACE_Reactor *r)
ACE_TRACE ("ACE_Notification_Handler::open");
this->reactor_ = r;
- this->notification_pipe_.open ();
+ if (this->notification_pipe_.open () == -1)
+ return -1;
#if !defined (ACE_WIN32) // There seems to be a Win32 bug with this...
// Set this into non-blocking mode.
diff --git a/ace/Thread.i b/ace/Thread.i
index 7d648b9207c..88d2b1bfcf2 100644
--- a/ace/Thread.i
+++ b/ace/Thread.i
@@ -196,14 +196,18 @@ ACE_Thread::setcancelstate (struct cancel_state &new_state,
int old_ctype;
if (new_state.cancelstate != 0
- && ACE_OS::thr_setcancelstate (new_state.cancelstate, &old_cstate) == 0)
+ && ACE_OS::thr_setcancelstate (new_state.cancelstate,
+ &old_cstate) == 0)
return -1;
if (new_state.canceltype != 0
- && ACE_OS::thr_setcanceltype (new_state.canceltype, &old_ctype) == 0)
+ && ACE_OS::thr_setcanceltype (new_state.canceltype,
+ &old_ctype) == 0)
{
int o_cstate;
- ACE_OS::thr_setcancelstate (old_cstate, &o_cstate);
+
+ ACE_OS::thr_setcancelstate (old_cstate,
+ &o_cstate);
return -1;
}
diff --git a/ace/Token.h b/ace/Token.h
index f75180c4b71..5c85022165c 100644
--- a/ace/Token.h
+++ b/ace/Token.h
@@ -26,7 +26,7 @@
class ACE_Export ACE_Token
// = TITLE
// Class that acquires, renews, and releases a synchronization
- // token that is local to the process.
+ // token that is serviced in strict FIFO ordering.
//
// = DESCRIPTION
// This class is a more general-purpose synchronization mechanism
@@ -34,8 +34,8 @@ class ACE_Export ACE_Token
// mutex" semantics, where a thread that owns the token can
// reacquire it without deadlocking. In addition, threads that are
// blocked awaiting the token are serviced in strict FIFO order as
- // other threads release the token (SunOS 5.x mutexes don't strictly
- // enforce an acquisition order).
+ // other threads release the token (Solaris and Pthread mutexes don't
+ // strictly enforce an acquisition order).
{
public:
// = Initialization and termination.