Обзор
Примеры
Скриншоты
Сравнения
Приложения
Загрузить
Руководства
Базар
Статус и История
Частые вопросы (FAQ)
Авторы и лицензия
Форум
Помощь проекту
Поиск по сайту
Язык
русский











SourceForge.net Logo



Эта страница еще не переведена. Вы хотите перевести?

 

Thread

 

class Thread : private NoCopy

Encapsulation of thread.

 

 

Constructor Detail

 

Thread()

Default constructor.

 


 

~Thread()

Destructor. Performs Detach - thread continues running.

 

 

Public Method List

 

bool Run(Callback cb)

Starts a new thread.

 


 

void Detach()

Detaches running thread from the Thread object. It means that thread continues running but is no longer controlled by Thread instance.

 


 

int Wait()

Waits for started thread to finish. ("join").

 


 

bool IsOpen() const

Thread represents an existing thread. Note that the thread can be already finished and not running anymore (calling to Wait in that case returns immediately).

 


 

HANDLE GetHandle() const [WIN32]

pthread_t GetHandle() const [POSIX]

Returns platform specific handle of thread.

 


 

static void Start(Callback cb)

Starts a thread and returns immediately (you cannot Wait for the thread to finish in this case).

 


 

static void Sleep(int ms)

Sleep for a given number of milliseconds.

 


 

static bool IsST()

No additional thread was started yet (only the main thread is running so far).

 


 

static bool IsMain()

Returns true if current thread is main.

 


 

static int GetCount()

Number of running threads.

 


 

static void ShutdownThreads()

Sets the "Shutdown" flag on.

 


 

static bool IsShutdownThreads()

True if ShutdownThreads was called.

 


 

static void (*AtExit(void (*exitfn)()))()

Allow to install a function exitfn to be called at thread exit. Returns the pointer to function already installed or NULL, client code should call the already installed function (return value is not null)

 


 

void Priority(int percent)

Sets the treads priority to percent (0 to 100).

 

 

Страница доступна на english языке. Вы хотите внести вклад?