Clarisse 4.0 SP5b SDK  4.0.0.0.5.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends | List of all members
SysThreadManager Class Reference
Inheritance diagram for SysThreadManager:
CoreBaseObject CoreBaseType

Public Member Functions

 SysThreadManager (const unsigned int &max_thread_count)
 
const unsigned int & get_max_thread_count () const
 
const unsigned int & get_thread_count () const
 
const unsigned int & get_sleeping_thread_count () const
 
unsigned int get_working_thread_count () const
 
void set_thread_count (const unsigned int &thread_count)
 
void log_hardware_info () const
 
- Public Member Functions inherited from CoreBaseObject
bool is_kindof (const CoreBaseObject &object) const
 
virtual size_t get_memory_size () const
 
CoreString get_class_info_name () const
 
CoreString get_class_interface () const
 
const unsigned long & get_class_info_id () const
 
bool is_kindof (const CoreClassInfo &cinfo) const
 
virtual const CoreClassInfoget_class_info () const
 
bool operator== (const CoreBaseObject &obj) const
 
template<class T >
T * cast ()
 
template<class T >
const T * cast () const
 
- Public Member Functions inherited from CoreBaseType
bool is_kindof (const CoreClassInfo &cinfo) const
 
bool operator== (const CoreBaseType &obj) const
 

Static Public Member Functions

static void lock (SysThreadLock &lock, const SysThreadLock::Duration &duration) noexcept(false)
 
static bool try_lock (SysThreadLock &lock, const SysThreadLock::Duration &duration) noexcept(false)
 
static void unlock (SysThreadLock &lock)
 
static void lock (SysThreadLockRecursive &lock, const SysThreadLock::Duration &duration)
 
static bool try_lock (SysThreadLockRecursive &lock, const SysThreadLock::Duration &duration)
 
static void unlock (SysThreadLockRecursive &lock)
 
static void yield (const unsigned int &sleep_time=SLEEP_NORMAL, const bool &is_preemptible=true)
 
static bool process_first_task (SysThreadTaskManager *task_manager)
 
static SysThreadManagerget_current_thread_manager ()
 
static unsigned int get_current_thread_index ()
 
- Static Public Member Functions inherited from CoreBaseObject
static const CoreClassInfoclass_info ()
 
static bool ___class_destructor__ (void *instance, const bool &is_array)
 
template<class T >
static T * cast (CoreBaseObject *object)
 
template<class T >
static const T * cast (const CoreBaseObject *object)
 
- Static Public Member Functions inherited from CoreBaseType
static bool ___class_destructor__ (void *instance, const bool &is_array)
 
static const CoreClassInfoclass_info ()
 

Static Public Attributes

static constexpr unsigned int INVALID_THREAD_INDEX = static_cast<unsigned int>(-1)
 
static constexpr unsigned int SLEEP_IMMEDIATE = 0
 
static constexpr unsigned int SLEEP_SOON = 2000
 
static constexpr unsigned int SLEEP_NORMAL = 4000
 
static constexpr unsigned int SLEEP_LATE = 8000
 
static constexpr unsigned int SLEEP_NEVER = static_cast<unsigned int>(-1)
 

Friends

class SysThreadTaskManager
 
class SysThreadWorker
 

Member Function Documentation

void SysThreadManager::lock ( SysThreadLock lock,
const SysThreadLock::Duration &  duration 
)
staticnoexcept

Tries to lock the given lock and blocks until locked.

Exceptions
SysThreadLock::DeadLockExceptionThrown when attempting to lock an already locked lock from the same thread.
Parameters
lockThe lock to lock.
durationHint for waiting duration.
bool SysThreadManager::try_lock ( SysThreadLock lock,
const SysThreadLock::Duration &  duration 
)
staticnoexcept

Tries to lock the given lock and returns immediately.

Exceptions
SysThreadLock::DeadLockExceptionThrown when attempting to lock an already locked lock from the same thread.
Parameters
lockThe lock to lock.
durationHint for waiting duration.
Returns
true on lock success, false if already locked.