doc ru, printf() before assert in containers

This commit is contained in:
2022-04-12 23:17:05 +03:00
parent 486fdf3dcd
commit 00830958df
18 changed files with 802 additions and 350 deletions

View File

@@ -54,54 +54,85 @@ __THREAD_FUNC_RET__ thread_function_once(void * t) {((PIThread*)t)->__thread_fun
# define UNREGISTER_THREAD(t)
#endif
/*! \class PIThread
* \brief Thread class
* \details This class allow you exec your code in separate thread.
*
* \section PIThread_sec0 Synopsis
* Multithreading allow you to write program which will be executed
* in several threads simultaneously. This trend allow you to use all
* cores of modern processors, but there are many dangers.
*
* This class provide virtual functions \a begin(), \a run() and \a end(),
* which describes start, execution and finish work of some process.
* These functions executes in \b separate thread. When you execute
* \a start(), %PIThread create separate system thread and sequentially
* executes function \a begin(), \a run() and \a end(). You can
* reimplement each function and write your own code to execute.
* Scheme of functions executing:
\code{.cpp}
begin();
event started();
while (isRunning()) {
run();
ThreadFunc();
piMSleep(timer_delay);
}
event stopped();
end();
\endcode
* Unlike from directly using "pthread" or some similar you doesn`t need
* to write your own main thread cycle and sleep at every cycle end.
* %PIThread make it for you, and your job is to set sleep value from
* contructor or when starting thread, and reimplement \a begin(), \a run()
* and \a end() functions.
*
* \section PIThread_sec1 Using without subclassing
* You can use %PIThread without subclassing by using "ThreadFunc" pointer
* that can be set from constructor or by overloaded function \a start(ThreadFunc func, int timer_delay).
* If "func" if not null this function will be executed as \a run(). ThreadFunc is any static
* function with format void func(void * data). "Data" is custom data set from constructor or
* with function \a setData(). \n Also you can connect to event \a started(), but
* in this case you should to white your thread main cycle, because this event raised only one time.
*
* \section PIThread_sec2 Locking
* %PIThread has inrternal mutex that can be locked and unlocked every \a run() if you set this flag
* with function \a needLockRun(bool). Also you can access to this mutex by functions \a lock(), \a unlock()
* and \a mutex(). Using this functions together with needLockRun(true) can guarantee one-thread access to
* some data.
*
*/
//! \addtogroup Thread
//! \{
//! \class PIThread pithread.h
//! \~\brief
//! \~english Thread class
//! \~russian Класс потока
//!
//! \~\details
//! \~english
//! This class allow you exec your code in separate thread.
//!
//! \~russian
//! Этот класс позволяет выполнять код из параллельного потока.
//!
//!
//! \~english \section PIThread_sec0 Synopsis
//! \~russian \section PIThread_sec0 Краткий обзор
//! \~english
//! Multithreading allow you to write program which will be executed
//! in several threads simultaneously. This trend allow you to use all
//! cores of modern processors, but there are many dangers.
//!
//! This class provide virtual functions \a begin(), \a run() and \a end(),
//! which describes start, execution and finish work of some process.
//! These functions executes in \b separate thread. When you execute
//! \a start(), %PIThread create separate system thread and sequentially
//! executes function \a begin(), \a run() and \a end(). You can
//! reimplement each function and write your own code to execute.
//! Scheme of functions executing:
//!
//! \~russian
//!
//! \~\code{.cpp}
//! begin();
//! event started();
//! while (isRunning()) {
//! run();
//! ThreadFunc();
//! piMSleep(timer_delay);
//! }
//! event stopped();
//! end();
//! \endcode
//!
//! \~english
//! Unlike from directly using "pthread" or some similar you doesn`t need
//! to write your own main thread cycle and sleep at every cycle end.
//! %PIThread make it for you, and your job is to set sleep value from
//! contructor or when starting thread, and reimplement \a begin(), \a run()
//! and \a end() functions.
//!
//! \~russian
//!
//!
//! \~english \section PIThread_sec1 Using without subclassing
//! \~russian \section PIThread_sec1 Использование без наследования
//! \~english
//! You can use %PIThread without subclassing by using "ThreadFunc" pointer
//! that can be set from constructor or by overloaded function \a start(ThreadFunc func, int timer_delay).
//! If "func" if not null this function will be executed as \a run(). ThreadFunc is any static
//! function with format void func(void * data). "Data" is custom data set from constructor or
//! with function \a setData(). \n Also you can connect to event \a started(), but
//! in this case you should to white your thread main cycle, because this event raised only one time.
//!
//! \~russian
//!
//!
//! \~english \section PIThread_sec2 Locking
//! \~russian \section PIThread_sec2 Блокировки
//! \~english
//! %PIThread has inrternal mutex that can be locked and unlocked every \a run() if you set this flag
//! with function \a needLockRun(bool). Also you can access to this mutex by functions \a lock(), \a unlock()
//! and \a mutex(). Using this functions together with needLockRun(true) can guarantee one-thread access to
//! some data.
//!
//! \~russian
//!
//! \}
//!
#ifndef MICRO_PIP