aboutsummaryrefslogtreecommitdiff
path: root/dep/ACE_wrappers/ace/Barrier.h
diff options
context:
space:
mode:
Diffstat (limited to 'dep/ACE_wrappers/ace/Barrier.h')
-rw-r--r--dep/ACE_wrappers/ace/Barrier.h41
1 files changed, 0 insertions, 41 deletions
diff --git a/dep/ACE_wrappers/ace/Barrier.h b/dep/ACE_wrappers/ace/Barrier.h
index 5fc9b9e8b7d..69b59c99115 100644
--- a/dep/ACE_wrappers/ace/Barrier.h
+++ b/dep/ACE_wrappers/ace/Barrier.h
@@ -1,5 +1,4 @@
// -*- C++ -*-
-
//==========================================================================
/**
* @file Barrier.h
@@ -11,26 +10,18 @@
* @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
*/
//==========================================================================
-
#ifndef ACE_BARRIER_H
#define ACE_BARRIER_H
#include /**/ "ace/pre.h"
-
#include /**/ "ace/ACE_export.h"
-
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
-
#include /**/ "ace/config-all.h"
-
// ACE platform supports some form of threading.
#if !defined (ACE_HAS_THREADS)
-
#include "ace/OS_NS_errno.h"
-
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-
/**
* @class ACE_Barrier
*
@@ -44,15 +35,10 @@ public:
int wait (void) { ACE_NOTSUP_RETURN (-1); }
void dump (void) const {}
};
-
ACE_END_VERSIONED_NAMESPACE_DECL
-
#else /* ACE_HAS_THREADS */
-
#include "ace/Condition_Thread_Mutex.h"
-
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
-
struct ACE_Export ACE_Sub_Barrier
{
// = Initialization.
@@ -60,22 +46,16 @@ struct ACE_Export ACE_Sub_Barrier
ACE_Thread_Mutex &lock,
const ACE_TCHAR *name = 0,
void *arg = 0);
-
~ACE_Sub_Barrier (void);
-
/// True if this generation of the barrier is done.
ACE_Condition_Thread_Mutex barrier_finished_;
-
/// Number of threads that are still running.
int running_threads_;
-
/// Dump the state of an object.
void dump (void) const;
-
/// Declare the dynamic allocation hooks.
ACE_ALLOC_HOOK_DECLARE;
};
-
/**
* @class ACE_Barrier
*
@@ -100,10 +80,8 @@ public:
ACE_Barrier (unsigned int count,
const ACE_TCHAR *name = 0,
void *arg = 0);
-
/// Default dtor.
~ACE_Barrier (void);
-
/// Block the caller until all @c count threads have called @c wait and
/// then allow all the caller threads to continue in parallel.
///
@@ -111,7 +89,6 @@ public:
/// @retval -1 if an error occurs or the barrier is shut
/// down (@sa shutdown ()).
int wait (void);
-
/// Shut the barrier down, aborting the wait of all waiting threads.
/// Any threads waiting on the barrier when it is shut down will return with
/// value -1, errno ESHUTDOWN.
@@ -120,24 +97,18 @@ public:
///
/// @since ACE beta 5.4.9.
int shutdown (void);
-
/// Dump the state of an object.
void dump (void) const;
-
/// Declare the dynamic allocation hooks.
ACE_ALLOC_HOOK_DECLARE;
-
protected:
/// Serialize access to the barrier state.
ACE_Thread_Mutex lock_;
-
/// Either 0 or 1, depending on whether we are the first generation
/// of waiters or the next generation of waiters.
int current_generation_;
-
/// Total number of threads that can be waiting at any one time.
int count_;
-
/**
* We keep two @c sub_barriers, one for the first "generation" of
* waiters, and one for the next "generation" of waiters. This
@@ -149,13 +120,11 @@ protected:
ACE_Sub_Barrier sub_barrier_1_;
ACE_Sub_Barrier sub_barrier_2_;
ACE_Sub_Barrier *sub_barrier_[2];
-
private:
// = Prevent assignment and initialization.
void operator= (const ACE_Barrier &);
ACE_Barrier (const ACE_Barrier &);
};
-
#if 0
/**
* @class ACE_Process_Barrier
@@ -170,15 +139,12 @@ class ACE_Export ACE_Process_Barrier : public ACE_Barrier
public:
/// Create a Process_Barrier, passing in the optional @a name.
ACE_Process_Barrier (unsigned int count, const ACE_TCHAR *name = 0);
-
/// Dump the state of an object.
void dump (void) const;
-
/// Declare the dynamic allocation hooks.
ACE_ALLOC_HOOK_DECLARE;
};
#endif /* 0 */
-
/**
* @class ACE_Thread_Barrier
*
@@ -192,25 +158,18 @@ class ACE_Export ACE_Thread_Barrier : public ACE_Barrier
public:
/// Create a Thread_Barrier, passing in the optional @a name.
ACE_Thread_Barrier (unsigned int count, const ACE_TCHAR *name = 0);
-
/// Default dtor.
~ACE_Thread_Barrier (void);
-
/// Dump the state of an object.
void dump (void) const;
-
/// Declare the dynamic allocation hooks.
ACE_ALLOC_HOOK_DECLARE;
};
-
ACE_END_VERSIONED_NAMESPACE_DECL
-
#if defined (__ACE_INLINE__)
#include "ace/Barrier.inl"
#endif /* __ACE_INLINE__ */
-
#endif /* !ACE_HAS_THREADS */
-
#include /**/ "ace/post.h"
#endif /* ACE_BARRIER_H */