Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenlib/BLI_threads.h
| Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | |||||
| /* Threading API */ | /* Threading API */ | ||||
| /*this is run once at startup*/ | /*this is run once at startup*/ | ||||
| void BLI_threadapi_init(void); | void BLI_threadapi_init(void); | ||||
| void BLI_threadapi_exit(void); | void BLI_threadapi_exit(void); | ||||
| struct TaskScheduler *BLI_task_scheduler_get(void); | struct TaskScheduler *BLI_task_scheduler_get(void); | ||||
| void BLI_threadpool_init(struct ListBase *threadbase, void *(*do_thread)(void *), int tot); | void BLI_threadpool_init(struct ListBase *threadbase, | ||||
| void *(*do_thread)(void *), | |||||
| int tot, | |||||
| const char *thread_name); | |||||
| int BLI_available_threads(struct ListBase *threadbase); | int BLI_available_threads(struct ListBase *threadbase); | ||||
| int BLI_threadpool_available_thread_index(struct ListBase *threadbase); | int BLI_threadpool_available_thread_index(struct ListBase *threadbase); | ||||
| void BLI_threadpool_insert(struct ListBase *threadbase, void *callerdata); | void BLI_threadpool_insert(struct ListBase *threadbase, void *callerdata); | ||||
| void BLI_threadpool_remove(struct ListBase *threadbase, void *callerdata); | void BLI_threadpool_remove(struct ListBase *threadbase, void *callerdata); | ||||
| void BLI_threadpool_remove_index(struct ListBase *threadbase, int index); | void BLI_threadpool_remove_index(struct ListBase *threadbase, int index); | ||||
| void BLI_threadpool_clear(struct ListBase *threadbase); | void BLI_threadpool_clear(struct ListBase *threadbase); | ||||
| void BLI_threadpool_end(struct ListBase *threadbase); | void BLI_threadpool_end(struct ListBase *threadbase); | ||||
| int BLI_thread_is_main(void); | int BLI_thread_is_main(void); | ||||
| void BLI_threaded_malloc_begin(void); | void BLI_threaded_malloc_begin(void); | ||||
| void BLI_threaded_malloc_end(void); | void BLI_threaded_malloc_end(void); | ||||
| /* System Information */ | /* System Information */ | ||||
| int BLI_system_thread_count(void); /* gets the number of threads the system can make use of */ | int BLI_system_thread_count(void); /* gets the number of threads the system can make use of */ | ||||
| void BLI_system_num_threads_override_set(int num); | void BLI_system_num_threads_override_set(int num); | ||||
| int BLI_system_num_threads_override_get(void); | int BLI_system_num_threads_override_get(void); | ||||
| /* Thread name */ | |||||
| /** | |||||
| * \brief Sets the name of the currently running thread. Normally used to aid debugging. | |||||
| * \param thread_name Name of the thread, must be less than 15 characters. | |||||
| */ | |||||
| void BLI_thread_name_set(const char *thread_name); | |||||
| /* Global Mutex Locks | /* Global Mutex Locks | ||||
| * | * | ||||
| * One custom lock available now. can be extended. */ | * One custom lock available now. can be extended. */ | ||||
| #define LOCK_IMAGE 0 | #define LOCK_IMAGE 0 | ||||
sergey: As per style guide, `const char *thread_name` | |||||
Done Inline ActionsTypo, thank you. velocity: Typo, thank you. | |||||
| #define LOCK_DRAW_IMAGE 1 | #define LOCK_DRAW_IMAGE 1 | ||||
| #define LOCK_VIEWER 2 | #define LOCK_VIEWER 2 | ||||
| #define LOCK_CUSTOM1 3 | #define LOCK_CUSTOM1 3 | ||||
| #define LOCK_RCACHE 4 | #define LOCK_RCACHE 4 | ||||
| #define LOCK_OPENGL 5 | #define LOCK_OPENGL 5 | ||||
| #define LOCK_NODES 6 | #define LOCK_NODES 6 | ||||
| #define LOCK_MOVIECLIP 7 | #define LOCK_MOVIECLIP 7 | ||||
| #define LOCK_COLORMANAGE 8 | #define LOCK_COLORMANAGE 8 | ||||
| ▲ Show 20 Lines • Show All 126 Lines • Show Last 20 Lines | |||||
As per style guide, const char *thread_name