xtd 0.2.0
xtd::threading Namespace Reference

Definition

The xtd::threading namespace provides classes and interfaces that enable multithreaded programming. In addition to classes for synchronizing thread activities and access to data ( xtd::threading::mutex, xtd::threading::monitor, xtd::threading::interlocked, xtd::threading::auto_reset_event, and so on), this namespace includes a xtd::threading::thread_pool class that allows you to use a pool of system-supplied threads, and a xtd::threading::timer class that executes callback methods on thread pool threads.

Classes

class  abandoned_mutex_exception
 The exception that is thrown when a Thread is in an invalid ThreadState for the method call. More...
 
class  auto_reset_event
 Represents a thread synchronization event that, when signaled, resets automatically after releasing a single waiting thread. This class cannot be inherited. More...
 
class  barrier
 Enables multiple tasks to cooperatively work on an algorithm in parallel through multiple phases. More...
 
class  barrier_post_phase_exception
 The exception that is thrown when a Thread is in an invalid ThreadState for the method call. More...
 
class  cancellation_token
 Propagates notification that operations should be canceled. More...
 
class  cancellation_token_registration
 Propagates notification that operations should be canceled. More...
 
class  cancellation_token_source
 Signals to a xtd::threading::cancellation_token that it should be canceled. More...
 
class  countdown_event
 Represents a synchronization primitive that is signaled when its count reaches zero. More...
 
class  event_wait_handle
 Represents a thread synchronization event. More...
 
class  interlocked
 Provides atomic operations for variables that are shared by multiple threads. More...
 
class  lock_guard
 Provides a mechanism that synchronizes access to objects with xtd::threading::monitor. More...
 
class  lock_recursion_exception
 The exception that is thrown when a Thread is in an invalid ThreadState for the method call. More...
 
class  manual_reset_event
 Represents a thread synchronization event that, when signaled, must be reset manually. This class cannot be inherited. More...
 
class  monitor
 Provides a mechanism that synchronizes access to objects. More...
 
class  mutex
 A synchronization primitive that can also be used for interprocess synchronization. More...
 
class  registered_wait_handle
 A synchronization primitive that can also be used for interprocess synchronization. More...
 
class  semaphore
 Limits the number of threads that can access a resource or pool of resources concurrently. More...
 
class  semaphore_full_exception
 The exception that is thrown when a method call is invalid for the object's current state. More...
 
class  spin_lock
 Provides a mutual exclusion lock primitive where a thread trying to acquire the lock waits in a loop repeatedly checking until the lock becomes available. More...
 
class  synchronization_lock_exception
 The exception that is thrown when a Thread is in an invalid ThreadState for the method call. More...
 
class  thread
 Creates and controls a thread, sets its priority, and gets its status. More...
 
class  thread_abort_exception
 The exception that is thrown when a method call is invalid for the object's current state. More...
 
class  thread_interrupted_exception
 The exception that is thrown when a Thread is interrupted while it is in a waiting state. More...
 
class  thread_local_object
 Provides thread-local storage of data. More...
 
class  thread_pool
 Provides a pool of threads that can be used to execute tasks, post work items, process asynchronous I/O, wait on behalf of other threads, and process timers. More...
 
class  thread_state_exception
 The exception that is thrown when a Thread is in an invalid ThreadState for the method call. More...
 
class  timeout
 Contains a constant used to specify an infinite amount of time. This class cannot be inherited. More...
 
class  timer
 Provides a mechanism for executing a method on a thread pool thread at specified intervals. This class cannot be inherited. More...
 
class  wait_handle
 Encapsulates operating system specific objects that wait for exclusive access to shared resources. More...
 
class  wait_handle_cannot_be_opened_exception
 The exception that is thrown when a Thread is in an invalid ThreadState for the method call. More...
 

Alias

using parameterized_thread_start = delegate< void(std::any)>
 Represents the method that executes on a xtd::threading::thread. More...
 
using thread_start = delegate< void()>
 Represents the method that executes on a xtd::threading::thread. More...
 
using timer_callback = action< std::any >
 Represents the method that handles calls from a xtd::threading::timer. More...
 
using wait_callback = delegate< void(std::any)>
 Represents a callback method to be executed by a thread pool thread. More...
 
using wait_or_timer_callback = delegate< void(std::any, bool)>
 Represents a method to be called when a xtd::threading::wait_handle is signaled or times out. More...
 

Enumerations

enum  event_reset_mode {
  event_reset_mode::auto_reset = 0,
  event_reset_mode::manual_reset = 1
}
 Indicates whether an xtd::threading::event_wait_handle is reset automatically or manually after receiving a signal. More...
 
enum  thread_priority {
  thread_priority::lowest = 0,
  thread_priority::below_normal = 1,
  thread_priority::normal = 2,
  thread_priority::above_normal = 3,
  thread_priority::highest = 4
}
 Specifies the scheduling priority of a system::threading::thread. More...
 
enum  thread_state {
  thread_state::running = 0x0000,
  thread_state::stop_requested = 0x0001,
  thread_state::suspend_requested = 0x0002,
  thread_state::background = 0x0004,
  thread_state::unstarted = 0x0008,
  thread_state::stopped = 0x0010,
  thread_state::wait_sleep_join = 0x0020,
  thread_state::suspended = 0x0040,
  thread_state::abort_requested = 0x0080,
  thread_state::aborted = 0x0100
}
 Specifies the execution states of a System::Threading::Thread. More...