*Massive cleanup (\n\n -> \n, *\n -> \n, cleanup for(...) to for (...), and some other cleanups by hand)
*Fix a possible crash in Spell::DoAllEffectOnTarget --HG-- branch : trunk
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
// -*- C++ -*-
|
||||
|
||||
//=============================================================================
|
||||
/**
|
||||
* @file Sched_Params.h
|
||||
@@ -10,22 +9,16 @@
|
||||
* @author Carlos O'Ryan <[email protected]>
|
||||
*/
|
||||
//=============================================================================
|
||||
|
||||
#ifndef ACE_SCHED_PARAMS_H
|
||||
#define ACE_SCHED_PARAMS_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/Time_Value.h"
|
||||
#include "ace/OS_NS_Thread.h"
|
||||
|
||||
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
|
||||
|
||||
/**
|
||||
* @class ACE_Sched_Params
|
||||
*
|
||||
@@ -63,7 +56,6 @@ class ACE_Export ACE_Sched_Params
|
||||
// priority of their LWP. The only way to do that through ACE is
|
||||
// for the RT thread itself to call <ACE_OS::thr_setprio> with
|
||||
// it's own priority.
|
||||
|
||||
// OS Scheduling parameters are complicated and often confusing.
|
||||
// Many thanks to Thilo Kielmann
|
||||
// <[email protected]> for his careful review of
|
||||
@@ -72,35 +64,27 @@ class ACE_Export ACE_Sched_Params
|
||||
// send any comments or corrections to the ACE developers.
|
||||
public:
|
||||
typedef int Policy;
|
||||
|
||||
// = Initialization and termination methods.
|
||||
/// Constructor.
|
||||
ACE_Sched_Params (const Policy policy,
|
||||
const ACE_Sched_Priority priority,
|
||||
const int scope = ACE_SCOPE_THREAD,
|
||||
const ACE_Time_Value &quantum = ACE_Time_Value::zero);
|
||||
|
||||
/// Termination.
|
||||
~ACE_Sched_Params (void);
|
||||
|
||||
// = Get/Set methods:
|
||||
|
||||
// = Get/Set policy
|
||||
Policy policy (void) const;
|
||||
void policy (const Policy);
|
||||
|
||||
// = Get/Set priority.
|
||||
ACE_Sched_Priority priority (void) const;
|
||||
void priority (const ACE_Sched_Priority);
|
||||
|
||||
// = Get/Set scope.
|
||||
int scope (void) const;
|
||||
void scope(const int);
|
||||
|
||||
// = Get/Set quantum.
|
||||
const ACE_Time_Value &quantum (void) const;
|
||||
void quantum (const ACE_Time_Value &);
|
||||
|
||||
// = Accessors for OS-specific priorities.
|
||||
// These return priority values for ACE_SCHED_OTHER if the Policy value
|
||||
// is invalid.
|
||||
@@ -108,7 +92,6 @@ public:
|
||||
const int scope = ACE_SCOPE_THREAD);
|
||||
static int priority_max (const Policy,
|
||||
const int scope = ACE_SCOPE_THREAD);
|
||||
|
||||
/**
|
||||
* The next higher priority. "Higher" refers to scheduling priority,
|
||||
* not to the priority value itself. (On some platforms, higher scheduling
|
||||
@@ -119,7 +102,6 @@ public:
|
||||
static int next_priority (const Policy,
|
||||
const int priority,
|
||||
const int scope = ACE_SCOPE_THREAD);
|
||||
|
||||
/**
|
||||
* The previous, lower priority. "Lower" refers to scheduling priority,
|
||||
* not to the priority value itself. (On some platforms, lower scheduling
|
||||
@@ -130,15 +112,12 @@ public:
|
||||
static int previous_priority (const Policy,
|
||||
const int priority,
|
||||
const int scope = ACE_SCOPE_THREAD);
|
||||
|
||||
private:
|
||||
/// Scheduling policy.
|
||||
Policy policy_;
|
||||
|
||||
/// Default <priority_>: for setting the priority for the process, LWP,
|
||||
/// or thread, as indicated by the scope_ parameter.
|
||||
ACE_Sched_Priority priority_;
|
||||
|
||||
/**
|
||||
* <scope_> must be one of the following:
|
||||
* ACE_SCOPE_PROCESS: sets the scheduling policy for the
|
||||
@@ -156,7 +135,6 @@ private:
|
||||
* by using system calls outside of ACE.
|
||||
*/
|
||||
int scope_;
|
||||
|
||||
/**
|
||||
* The <quantum_> is for time slicing. An ACE_Time_Value of 0 has
|
||||
* special significance: it means time-slicing is disabled; with
|
||||
@@ -167,7 +145,6 @@ private:
|
||||
*/
|
||||
ACE_Time_Value quantum_;
|
||||
};
|
||||
|
||||
/**
|
||||
* @class ACE_Sched_Priority_Iterator
|
||||
*
|
||||
@@ -185,35 +162,26 @@ public:
|
||||
/// policy and scope for the priorities (see ACE_Sched_Param).
|
||||
ACE_Sched_Priority_Iterator (const ACE_Sched_Params::Policy &policy,
|
||||
int scope = ACE_SCOPE_THREAD);
|
||||
|
||||
/// Default dtor.
|
||||
~ACE_Sched_Priority_Iterator (void);
|
||||
|
||||
/// Check if there are more priorities.
|
||||
int more (void) const;
|
||||
|
||||
/// Return the current priority.
|
||||
int priority (void) const;
|
||||
|
||||
/// Move to the next priority.
|
||||
/// The iteration is from lowest to highest importance.
|
||||
void next (void);
|
||||
|
||||
/// Accessor for the scheduling policy over which we are iterating.
|
||||
const ACE_Sched_Params::Policy &policy (void) const;
|
||||
|
||||
/// Accessor for the scheduling
|
||||
int scope (void) const;
|
||||
|
||||
private:
|
||||
/// The Scheduling policy (FIFO, RR, etc.) and scheduling scope
|
||||
/// (PROCESS, SYSTEM) we are iterating on.
|
||||
ACE_Sched_Params::Policy policy_;
|
||||
int scope_;
|
||||
|
||||
/// The current priority.
|
||||
int priority_;
|
||||
|
||||
/**
|
||||
* This is set to 1 when there are no more priorities. Cannot easily
|
||||
* compare against the highest priority on platforms were priorities
|
||||
@@ -221,13 +189,10 @@ private:
|
||||
*/
|
||||
int done_;
|
||||
};
|
||||
|
||||
ACE_END_VERSIONED_NAMESPACE_DECL
|
||||
|
||||
#if defined (__ACE_INLINE__)
|
||||
#include "ace/Sched_Params.inl"
|
||||
#endif /* __ACE_INLINE__ */
|
||||
|
||||
#include /**/ "ace/post.h"
|
||||
#endif /* ACE_SCHED_PARAMS_H */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user