This page has been translated automatically.
Видеоуроки
Интерфейс
Основы
Продвинутый уровень
Подсказки и советы
Основы
Программирование на C#
Рендеринг
Профессиональный уровень (SIM)
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Физика
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Контроль версий
Настройки и предпочтения
Работа с проектами
Настройка параметров ноды
Setting Up Materials
Настройка свойств
Освещение
Sandworm
Использование инструментов редактора для конкретных задач
Расширение функционала редактора
Встроенные объекты
Ноды (Nodes)
Объекты (Objects)
Эффекты
Декали
Источники света
Geodetics
World-ноды
Звуковые объекты
Объекты поиска пути
Player-ноды
Программирование
Основы
Настройка среды разработки
Примеры использования
C++
C#
UUSL (Unified UNIGINE Shader Language)
Плагины
Форматы файлов
Материалы и шейдеры
Rebuilding the Engine Tools
Интерфейс пользователя (GUI)
Двойная точность координат
API
Animations-Related Classes
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
VR-Related Classes
Работа с контентом
Оптимизация контента
Материалы
Визуальный редактор материалов
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Учебные материалы

Thread

Warning
The scope of applications for UnigineScript is limited to implementing materials-related logic (material expressions, scriptable materials, brush materials). Do not use UnigineScript as a language for application logic, please consider C#/C++ instead, as these APIs are the preferred ones. Availability of new Engine features in UnigineScript (beyond its scope of applications) is not guaranteed, as the current level of support assumes only fixing critical issues.

int thread ( string function_name, variable arguments ) #

Places a function into the list (FIFO) for thread initialization. The functions from this list are started at the end of any script function execution, which was called from C++ (init(), shutdown(), update() of any script). Target functions must use the wait statement to free the processor for other tasks. Each thread has its own scope.

Arguments

  • string function_name - Name of the function to place into the list for thread initialization.
  • variable arguments - Function arguments.

Return value

Thread ID. It can be used to terminate the thread via kill_thread().

Examples

Source code (UnigineScript)
void log_argument(int arg) {
	while(1) {
		log.message("Argument: %d",arg);
		wait;
	}
}

for(int i = 0; i < 10; i++) {
	thread("log_argument",i);
}

int thread ( string function_name, variable array ) #

Places a function into the list (FIFO) for thread initialization. The number of function arguments can vary.

Arguments

  • string function_name - Name of the function to place into the list for thread initialization.
  • variable array - Function arguments. The number of arguments can vary.

Return value

Thread ID. It can be used to terminate the thread via kill_thread().

See also: Execution Sequence.

Last update: 03.07.2017
Build: ()