Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::Thread::Attributes Class Reference

Thread attributes used internally for starting a thread. More...

#include <Thread.h>

Public Types

enum  ESchedulePolicy : int {
  spScheduleOther = SCHED_OTHER , spScheduleFifo = SCHED_FIFO , spScheduleRoundRobin = SCHED_RR , spScheduleBatch = SCHED_BATCH ,
  spScheduleIdle = SCHED_IDLE , spScheduleResetOnFork = SCHED_RESET_ON_FORK
}
 Thread schedule policies. More...
 
typedef ::pthread_attr_t * handle_type
 

Public Member Functions

 Attributes ()
 Default Constructor.
 
 Attributes (const Attributes &)=delete
 Prevent copying.
 
Attributesoperator= (const Attributes &)=delete
 Prevent assignment.
 
 Attributes (Thread::handle_type th)
 Initialize using the passed thread handle.
 
 ~Attributes ()
 Destructor.
 
void setup (Thread::handle_type th=0)
 When the handle is '0' the current thread is used.
 
size_t getStackSize () const
 Gets the stack size of the thread which initialized it.
 
void setStackSize (size_t sz)
 Sets the stack size for a new thread.
 
void setSchedulePolicy (ESchedulePolicy policy)
 Sets scheduling priority for the to be started thread.
 
ESchedulePolicy getSchedulePolicy () const
 Gets the current set scheduling priority.
 
 operator handle_type () const
 Handle casting operator.
 

Detailed Description

Thread attributes used internally for starting a thread.

Member Typedef Documentation

◆ handle_type

typedef ::pthread_attr_t* sf::Thread::Attributes::handle_type

Handle type of thread.

Member Enumeration Documentation

◆ ESchedulePolicy

Thread schedule policies.

Enumerator
spScheduleOther 

Scheduling behavior is determined by the operating system.

spScheduleFifo 

Threads are scheduled in a first-in-first-out order within each priority.

spScheduleRoundRobin 

Threads are scheduled in a round-robin fashion within each priority.

spScheduleBatch 
spScheduleIdle 
spScheduleResetOnFork 

Constructor & Destructor Documentation

◆ Attributes() [1/3]

sf::Thread::Attributes::Attributes ( )

Default Constructor.

◆ Attributes() [2/3]

sf::Thread::Attributes::Attributes ( const Attributes )
delete

Prevent copying.

◆ Attributes() [3/3]

sf::Thread::Attributes::Attributes ( Thread::handle_type  th)
explicit

Initialize using the passed thread handle.

When the handle is '0' the current thread is used.

See also
setup()
Exceptions
Exception

◆ ~Attributes()

sf::Thread::Attributes::~Attributes ( )

Destructor.

Member Function Documentation

◆ getSchedulePolicy()

ESchedulePolicy sf::Thread::Attributes::getSchedulePolicy ( ) const

Gets the current set scheduling priority.

◆ getStackSize()

size_t sf::Thread::Attributes::getStackSize ( ) const

Gets the stack size of the thread which initialized it.

◆ operator handle_type()

sf::Thread::Attributes::operator handle_type ( ) const
inline

Handle casting operator.

◆ operator=()

Attributes & sf::Thread::Attributes::operator= ( const Attributes )
delete

Prevent assignment.

◆ setSchedulePolicy()

void sf::Thread::Attributes::setSchedulePolicy ( ESchedulePolicy  policy)

Sets scheduling priority for the to be started thread.

◆ setStackSize()

void sf::Thread::Attributes::setStackSize ( size_t  sz)

Sets the stack size for a new thread.

The stack size retrieved using getCurrentStackSize() is an aligned value and can report less than is passed in this function.

◆ setup()

void sf::Thread::Attributes::setup ( Thread::handle_type  th = 0)

When the handle is '0' the current thread is used.

Parameters
thThread handle declared in
Exceptions
TException

The documentation for this class was generated from the following file: