thread doc ru

This commit is contained in:
2022-04-21 22:26:49 +03:00
parent 93b881da1b
commit 9deae168a6
7 changed files with 468 additions and 97 deletions

View File

@@ -169,19 +169,12 @@ public:
EVENT(started)
EVENT(stopped)
//! \~english
//! Start event handler with name "handler" of object "object"
//! in separate thread with name "name"
//! and automatically delete it on function finish
//!
//! \~russian
//! \~english Call event handler "handler" of object "object" in separate thread
//! \~russian Вызывает обработчик "handler" объекта "object" в отдельном потоке
static void runOnce(PIObject * object, const char * handler, const PIString & name = PIString());
//! \~english
//! Start function "func" in separate thread with name "name"
//! and automatically delete it on function finish
//!
//! \~russian
//! \~english Call lambda-function "func" in separate thread
//! \~russian Вызывает лямбда-функцию "func" в отдельном потоке
static void runOnce(std::function<void()> func, const PIString & name = PIString());
//! \handlers
@@ -190,72 +183,30 @@ public:
//! \fn bool start(int timer_delay = -1)
//! \~english Start thread
//! \~russian Запускает поток
//! \~\details
//! \~english
//! Start execution of \a run() in internal loop with
//! "timer_delay" delay in milliseconds. If "timer_delay" <= 0
//! there is no delay in loop. Thread also exec external function
//! set by \a setSlot() if it`s not null
//! \return \c false if thread already started or can`t start thread
//! \~russian
//! \fn bool startOnce()
//! \~english Start thread without internal loop
//! \~russian Запускает поток без внутреннего цикла
//! \~\details
//! \~english
//! Start execution of \a run() once. Thread also exec
//! external function set by \a setSlot() if it`s not null
//! \return \c false if thread already started or can`t start thread
//! \~russian
//! \fn bool startOnce(ThreadFunc func)
//! \~english Start thread without internal loop
//! \~russian Запускает поток без внутреннего цикла
//! \~\details
//! \~english
//! Overloaded function. Set external function "func" before start
//! \return \c false if thread already started or can`t start thread
//! \~russian
//! \fn void stop(bool wait = false)
//! \~english Stop thread
//! \~russian Останавливает поток
//! \~\details
//! \~english
//! Stop execution of thread and wait for it finish
//! if "wait" is \c true. This function can block for infinite
//! time if "wait" is \c true and any of thread function is
//! busy forever
//! \~russian
//! \fn void terminate()
//! \~english Strongly stop thread
//! \~russian Жестко останавливает поток
//! \~\details
//! \~english
//! Stop execution of thread immediately
//! \~russian
//! \fn bool waitForStart(int timeout_msecs = -1)
//! \~english Wait for thread start
//! \~russian Ожидает старта потока
//! \~\details
//! \~english
//! This function block until thread start for "timeout_msecs"
//! or forever if "timeout_msecs" < 0
//! \return \c false if timeout is exceeded
//! \~russian
//! \fn bool waitForFinish(int timeout_msecs = -1)
//! \~english Wait for thread finish
//! \~russian Ожидает завершения потока
//! \~\details
//! \~english
//! This function block until thread finish for "timeout_msecs"
//! or forever if "timeout_msecs" < 0
//! \return \c false if timeout is exceeded
//! \~russian
//! \fn void lock()
//! \~english Lock internal mutex