2#ifndef _aspose_system_threading_thread_h_
3#define _aspose_system_threading_thread_h_
7#include <condition_variable>
9#include <system/multicast_delegate.h>
10#include <system/globalization/culture_info.h>
11#include <system/threading/thread_state.h>
17 namespace ComponentModel {
18 class BackgroundWorker;
127 ASPOSECPP_SHARED_API
void Join();
131 ASPOSECPP_SHARED_API
bool Join(
int millisecondsTimeout);
138 static ASPOSECPP_SHARED_API
void Sleep(
int millisecondsTimeout);
144 static ASPOSECPP_SHARED_API
void SpinWait(
int iterations);
156 static ASPOSECPP_SHARED_API
bool Yield();
177 bool is_backgroung =
false;
179 bool is_thread_pool_thread =
false;
181 bool is_ready =
false;
183 std::timed_mutex m_timed_mutex;
185 std::condition_variable m_cv_sleep;
187 std::mutex m_mtx_cv_sleep;
201 std::thread m_thread;
203 static std::shared_ptr<TlsData>& GetTlsData();
205 std::shared_ptr<TlsData> m_data;
213 static ASPOSECPP_SHARED_API
void CheckIsValidTimeout(
TimeSpan timeout);
216 static ASPOSECPP_SHARED_API
void InitTlsData();
Objects of this class should only be allocated using System::MakeObject() function....
Definition: background_worker.h:20
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:62
Object & operator=(Object const &x)
Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy cons...
Definition: object.h:81
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:122
Thread implementation. Objects of this class should only be allocated using System::MakeObject() func...
Definition: thread.h:58
static void Sleep(TimeSpan timeout)
Stops current thread for specified timeout.
bool Join(TimeSpan timeout)
Joins managed thread. Performs limited waiting.
void Abort()
Aborts thread. Not implemented.
static System::SharedPtr< Thread > get_CurrentThread()
Gets object which describes current thread.
bool Join(int millisecondsTimeout)
Joins managed thread. Performs limited waiting.
static void Sleep(int millisecondsTimeout)
Stops current thread for specified timeout.
void set_Name(const System::String &name)
Sets thread name.
ThreadState get_ThreadState()
Gets thread state.
Thread(ParameterizedThreadStart thread_function)
Constructor.
void set_CurrentCulture(const SharedPtr< Globalization::CultureInfo > &ci)
Sets thread culture.
bool get_IsBackground()
Checks whether thread is background.
static int GetCurrentThreadId()
Gets identifier of current thread.
virtual ~Thread()
Destructor.
System::String get_Name()
Gets thread name.
int get_ManagedThreadId() const
Gets identifier of thread. Can be got from OS, but if OS thread identifier exceeds int limits,...
static void MemoryBarrier()
Synchronizes memory access.
virtual int GetHashCode() const override
Thread(ThreadStart thread_function)
Constructor.
void Join()
Joins managed thread. Performs unlimited waiting if required.
void Start(const System::SharedPtr< System::Object > &o)
Starts thread.
bool get_IsThreadPoolThread()
Checks if thread is owned by a thread pool.
void set_CurrentUICulture(const SharedPtr< Globalization::CultureInfo > &ci)
Sets user interface culture used by thread.
static void SpinWait(int iterations)
Waits for specific number of loop iterations.
static bool Yield()
Yields thread.
SharedPtr< Globalization::CultureInfo > get_CurrentUICulture()
Gets user interface culture used by thread.
SharedPtr< Globalization::CultureInfo > get_CurrentCulture()
Gets thread culture.
void Interrupt()
Interrupt thread. Not implemented.
void set_IsBackground(bool is_background)
Sets thread to background or foreground.
Thread(Thread &t)
Copy constructor.
bool get_IsAlive()
Checks whether thread is alive.
void Start()
Starts thread using null argument object.
Thread pool internal data. This is a singleton type with memory management done by access function(s)...
Definition: thread_pool.h:23
Represents a time interval. This type should be allocated on stack and passed to functions by value o...
Definition: timespan.h:59
System::MulticastDelegate< void(System::SharedPtr< System::Object >)> ParameterizedThreadStart
Thread function with single parameter.
Definition: thread.h:24
System::MulticastDelegate< void()> ThreadStart
Thread function with no parameters.
Definition: thread.h:26
ThreadState
State of the thread.
Definition: thread_state.h:9
@ Unstarted
Thread is not started.
Definition: thread_state.h:19
Definition: db_command.h:9