Blender V2.61 - r43446
|
#include <pthread.h>
Go to the source code of this file.
Definition in file BLI_threads.h.
#define BLENDER_MAX_THREADS 64 |
Definition at line 40 of file BLI_threads.h.
Referenced by BLI_thread_srandom(), free_render_qmcsampler(), freeraytree(), init_ao_sphere(), init_jitter_plane(), init_render_qmcsampler(), make_occ_tree(), ntreeShaderBeginExecTree(), ntreeShaderEndExecTree(), ntreeTexBeginExecTree(), ntreeTexEndExecTree(), occ_build_recursive(), occ_free_tree(), occ_tree_build(), project_paint_op(), RE_init_threadcount(), RE_set_max_threads(), render_realtime_texture(), rna_def_scene_render_data(), setupArguments(), tex_free_delegates(), and threadsafe_table_sphere().
#define BLI_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER |
Definition at line 86 of file BLI_threads.h.
#define LOCK_CUSTOM1 3 |
Definition at line 74 of file BLI_threads.h.
Referenced by BLI_lock_thread(), BLI_unlock_thread(), do_shadow_thread(), get_next_bake_face(), makeshadowbuf(), occ_build_recursive(), project_bucket_iter_next(), project_paint_face_init(), sculpt_undo_push_node(), shade_tface(), sss_add_points(), and threaded_makeshadowbufs().
#define LOCK_IMAGE 0 |
Definition at line 71 of file BLI_threads.h.
Referenced by BKE_image_acquire_ibuf(), BLI_lock_thread(), BLI_unlock_thread(), colorfn(), envmap_split_ima(), image_mipmap_test(), render_realtime_texture(), and save_render_result_tile().
#define LOCK_MOVIECLIP 7 |
Definition at line 78 of file BLI_threads.h.
Referenced by BLI_lock_thread(), BLI_unlock_thread(), movieclip_build_proxy_ibuf(), and movieclip_get_postprocessed_ibuf().
#define LOCK_NODES 6 |
Definition at line 77 of file BLI_threads.h.
Referenced by BLI_lock_thread(), BLI_unlock_thread(), ntreeShaderExecTree(), and ntreeTexExecTree().
#define LOCK_OPENGL 5 |
Definition at line 76 of file BLI_threads.h.
Referenced by BLI_lock_thread(), BLI_unlock_thread(), GPU_free_unused_buffers(), and gpu_queue_image_for_free().
#define LOCK_PREVIEW 1 |
Definition at line 72 of file BLI_threads.h.
Referenced by BLI_lock_thread(), BLI_unlock_thread(), generate_preview(), node_draw_basis(), and node_update_basis().
#define LOCK_RCACHE 4 |
Definition at line 75 of file BLI_threads.h.
Referenced by BLI_lock_thread(), and BLI_unlock_thread().
#define LOCK_VIEWER 2 |
Definition at line 73 of file BLI_threads.h.
Referenced by BKE_image_acquire_ibuf(), BKE_image_release_ibuf(), BLI_lock_thread(), BLI_unlock_thread(), and image_get_render_result().
#define THREAD_LOCK_READ 1 |
Definition at line 95 of file BLI_threads.h.
Referenced by BLI_rw_mutex_lock(), RE_AcquireResultImage(), and RE_AcquireResultRead().
#define THREAD_LOCK_WRITE 2 |
Definition at line 96 of file BLI_threads.h.
Referenced by do_merge_fullsample(), do_render_blur_3d(), do_render_composite_fields_blur_3d(), do_render_fields_3d(), do_render_fields_blur_3d(), do_render_seq(), RE_AcquireResultWrite(), RE_engine_render(), RE_InitState(), RE_ReadRenderResult(), render_initialize_from_main(), sss_create_tree_mat(), and threaded_tile_processor().
typedef pthread_mutex_t ThreadMutex |
Definition at line 85 of file BLI_threads.h.
typedef struct ThreadQueue ThreadQueue |
Definition at line 131 of file BLI_threads.h.
typedef pthread_rwlock_t ThreadRWMutex |
Definition at line 98 of file BLI_threads.h.
int BLI_available_thread_index | ( | struct ListBase * | threadbase | ) |
Definition at line 197 of file threads.c.
References ThreadSlot::avail, ListBase::first, and ThreadSlot::next.
Referenced by BLI_insert_work(), and threaded_tile_processor().
int BLI_available_threads | ( | struct ListBase * | threadbase | ) |
Definition at line 184 of file threads.c.
References ThreadSlot::avail, ListBase::first, and ThreadSlot::next.
Referenced by BLI_insert_work(), ntreeCompositExecTree(), and threaded_tile_processor().
void BLI_begin_threaded_malloc | ( | void | ) |
Definition at line 672 of file threads.c.
References BLI_lock_malloc_thread(), BLI_unlock_malloc_thread(), MEM_set_lock_callback(), and thread_levels.
Referenced by BKE_tracking_context_new(), and dynamicPaint_paintParticles().
struct ThreadedWorker* BLI_create_worker | ( | void *(*)(void *) | do_thread, |
int | tot, | ||
int | sleep_time | ||
) | [read] |
Definition at line 454 of file threads.c.
References BLI_init_threads(), exec_work_fnct(), MEM_callocN(), RE_MAX_THREAD, ThreadedWorker::threadbase, ThreadedWorker::total, and ThreadedWorker::work_fnct.
Referenced by newRigGraph().
void BLI_destroy_worker | ( | struct ThreadedWorker * | worker | ) |
Definition at line 484 of file threads.c.
References BLI_end_worker(), BLI_freelistN(), MEM_freeN(), and ThreadedWorker::threadbase.
Referenced by RIG_freeRigGraph().
void BLI_end_threaded_malloc | ( | void | ) |
Definition at line 680 of file threads.c.
References MEM_set_lock_callback(), NULL, and thread_levels.
Referenced by BKE_tracking_context_free(), and dynamicPaint_paintParticles().
void BLI_end_threads | ( | struct ListBase * | threadbase | ) |
Definition at line 283 of file threads.c.
References ThreadSlot::avail, BLI_freelistN(), ListBase::first, MEM_set_lock_callback(), ThreadSlot::next, NULL, ThreadSlot::pthread, and thread_levels.
Referenced by bake_image_exec(), BKE_ptcache_bake(), distribute_particles_on_dm(), make_occ_tree(), ntreeCompositExecTree(), occ_build_recursive(), project_paint_op(), psys_cache_child_paths(), RE_bake_shade_all_selected(), sb_cf_threads_run(), sb_sfesf_threads_run(), threaded_makeshadowbufs(), threaded_tile_processor(), vol_precache_objectinstance_threads(), wm_jobs_kill_job(), and wm_jobs_timer().
void BLI_end_worker | ( | struct ThreadedWorker * | worker | ) |
Definition at line 479 of file threads.c.
References BLI_remove_threads(), and ThreadedWorker::threadbase.
Referenced by BLI_destroy_worker(), and finishRetarget().
void BLI_init_threads | ( | struct ListBase * | threadbase, |
void *(*)(void *) | do_thread, | ||
int | tot | ||
) |
Definition at line 151 of file threads.c.
References ThreadSlot::avail, BLI_addtail(), BLI_lock_malloc_thread(), BLI_unlock_malloc_thread(), ThreadSlot::do_thread, ListBase::first, ListBase::last, MEM_callocN(), MEM_set_lock_callback(), NULL, RE_MAX_THREAD, and thread_levels.
Referenced by bake_image_exec(), BKE_ptcache_bake(), BLI_create_worker(), distribute_particles_on_dm(), make_occ_tree(), ntreeCompositExecTree(), occ_build_recursive(), project_paint_op(), psys_cache_child_paths(), RE_bake_shade_all_selected(), sb_cf_threads_run(), sb_sfesf_threads_run(), threaded_makeshadowbufs(), threaded_tile_processor(), vol_precache_objectinstance_threads(), and WM_jobs_start().
void BLI_insert_thread | ( | struct ListBase * | threadbase, |
void * | callerdata | ||
) |
Definition at line 227 of file threads.c.
References ThreadSlot::avail, ThreadSlot::callerdata, ListBase::first, ThreadSlot::next, NULL, ThreadSlot::pthread, and tslot_thread_start().
Referenced by bake_image_exec(), BKE_ptcache_bake(), BLI_insert_work(), distribute_particles_on_dm(), make_occ_tree(), ntreeCompositExecTree(), occ_build_recursive(), project_paint_op(), psys_cache_child_paths(), RE_bake_shade_all_selected(), sb_cf_threads_run(), sb_sfesf_threads_run(), threaded_makeshadowbufs(), threaded_tile_processor(), vol_precache_objectinstance_threads(), and WM_jobs_start().
void BLI_insert_work | ( | struct ThreadedWorker * | worker, |
void * | param | ||
) |
Definition at line 491 of file threads.c.
References BLI_available_thread_index(), BLI_available_threads(), BLI_insert_thread(), BLI_remove_thread_index(), ThreadedWorker::busy, WorkParam::index, MEM_callocN(), p, WorkParam::param, PIL_sleep_ms(), ThreadedWorker::sleep_time, ThreadedWorker::threadbase, ThreadedWorker::total, and WorkParam::worker.
Referenced by retargetArctoArc().
void BLI_lock_thread | ( | int | type | ) |
Definition at line 338 of file threads.c.
References _custom1_lock, _image_lock, _movieclip_lock, _nodes_lock, _opengl_lock, _preview_lock, _rcache_lock, _viewer_lock, LOCK_CUSTOM1, LOCK_IMAGE, LOCK_MOVIECLIP, LOCK_NODES, LOCK_OPENGL, LOCK_PREVIEW, LOCK_RCACHE, and LOCK_VIEWER.
Referenced by BKE_image_acquire_ibuf(), colorfn(), do_shadow_thread(), envmap_split_ima(), generate_preview(), get_next_bake_face(), GPU_free_unused_buffers(), gpu_queue_image_for_free(), image_get_render_result(), image_mipmap_test(), makeshadowbuf(), movieclip_build_proxy_ibuf(), movieclip_get_postprocessed_ibuf(), node_draw_basis(), node_update_basis(), ntreeShaderExecTree(), ntreeTexExecTree(), occ_build_recursive(), project_bucket_iter_next(), project_paint_face_init(), render_realtime_texture(), save_render_result_tile(), sculpt_undo_push_node(), shade_tface(), sss_add_points(), and threaded_makeshadowbufs().
void BLI_mutex_end | ( | ThreadMutex * | mutex | ) |
Definition at line 395 of file threads.c.
Referenced by imb_tile_cache_exit(), and proxy_freejob().
void BLI_mutex_init | ( | ThreadMutex * | mutex | ) |
Definition at line 380 of file threads.c.
References NULL.
Referenced by imb_tile_cache_init(), IMB_tile_cache_params(), and seq_proxy_build_job().
void BLI_mutex_lock | ( | ThreadMutex * | mutex | ) |
Definition at line 385 of file threads.c.
Referenced by imb_global_cache_get_tile(), imb_tile_cache_tile_free(), IMB_tiles_to_rect(), proxy_startjob(), and seq_proxy_build_job().
void BLI_mutex_unlock | ( | ThreadMutex * | mutex | ) |
Definition at line 390 of file threads.c.
Referenced by imb_global_cache_get_tile(), imb_tile_cache_tile_free(), IMB_tiles_to_rect(), proxy_startjob(), and seq_proxy_build_job().
void BLI_remove_thread | ( | struct ListBase * | threadbase, |
void * | callerdata | ||
) |
Definition at line 242 of file threads.c.
References ThreadSlot::avail, ThreadSlot::callerdata, ListBase::first, ThreadSlot::next, NULL, and ThreadSlot::pthread.
Referenced by ntreeCompositExecTree(), and threaded_tile_processor().
void BLI_remove_thread_index | ( | struct ListBase * | threadbase, |
int | index | ||
) |
Definition at line 255 of file threads.c.
References ThreadSlot::avail, ThreadSlot::callerdata, ListBase::first, ThreadSlot::next, NULL, and ThreadSlot::pthread.
Referenced by BLI_insert_work().
void BLI_remove_threads | ( | struct ListBase * | threadbase | ) |
Definition at line 270 of file threads.c.
References ThreadSlot::avail, ThreadSlot::callerdata, ListBase::first, ThreadSlot::next, NULL, and ThreadSlot::pthread.
Referenced by BLI_end_worker().
void BLI_rw_mutex_end | ( | ThreadRWMutex * | mutex | ) |
Definition at line 420 of file threads.c.
Referenced by RE_FreeRender().
void BLI_rw_mutex_init | ( | ThreadRWMutex * | mutex | ) |
void BLI_rw_mutex_lock | ( | ThreadRWMutex * | mutex, |
int | mode | ||
) |
Definition at line 407 of file threads.c.
References THREAD_LOCK_READ.
Referenced by do_merge_fullsample(), do_render_blur_3d(), do_render_composite_fields_blur_3d(), do_render_fields_3d(), do_render_fields_blur_3d(), do_render_seq(), RE_AcquireResultImage(), RE_AcquireResultRead(), RE_AcquireResultWrite(), RE_engine_render(), RE_InitState(), RE_ReadRenderResult(), render_initialize_from_main(), sss_create_tree_mat(), and threaded_tile_processor().
void BLI_rw_mutex_unlock | ( | ThreadRWMutex * | mutex | ) |
Definition at line 415 of file threads.c.
Referenced by do_merge_fullsample(), do_render_blur_3d(), do_render_composite_fields_blur_3d(), do_render_fields_3d(), do_render_fields_blur_3d(), do_render_seq(), RE_engine_render(), RE_InitState(), RE_ReadRenderResult(), RE_ReleaseResult(), RE_ReleaseResultImage(), render_initialize_from_main(), sss_create_tree_mat(), and threaded_tile_processor().
int BLI_system_thread_count | ( | void | ) |
Definition at line 307 of file threads.c.
References len(), NULL, and RE_MAX_THREAD.
Referenced by newRigGraph(), project_paint_begin(), psys_threads_create(), RE_init_threadcount(), RE_set_max_threads(), sb_cf_threads_run(), and sb_sfesf_threads_run().
int BLI_thread_is_main | ( | void | ) |
Definition at line 222 of file threads.c.
References mainid.
Referenced by ED_render_scene_update(), GPU_buffer_free(), GPU_free_image(), GPU_free_unused_buffers(), and seq_render_scene_strip_impl().
void BLI_thread_queue_free | ( | ThreadQueue * | queue | ) |
Definition at line 549 of file threads.c.
References BLI_gsqueue_free(), ThreadQueue< T >::cond, MEM_freeN(), ThreadQueue< T >::mutex, and ThreadQueue< T >::queue.
Referenced by vol_precache_objectinstance_threads().
ThreadQueue* BLI_thread_queue_init | ( | void | ) |
Definition at line 536 of file threads.c.
References BLI_gsqueue_new(), ThreadQueue< T >::cond, MEM_callocN(), ThreadQueue< T >::mutex, NULL, and ThreadQueue< T >::queue.
Referenced by vol_precache_objectinstance_threads().
void BLI_thread_queue_nowait | ( | ThreadQueue * | queue | ) |
Definition at line 661 of file threads.c.
References ThreadQueue< T >::cond, ThreadQueue< T >::mutex, and ThreadQueue< T >::nowait.
Referenced by vol_precache_objectinstance_threads().
void* BLI_thread_queue_pop | ( | ThreadQueue * | queue | ) |
Definition at line 570 of file threads.c.
References BLI_gsqueue_is_empty(), BLI_gsqueue_pop(), ThreadQueue< T >::cond, ThreadQueue< T >::mutex, ThreadQueue< T >::nowait, NULL, and ThreadQueue< T >::queue.
Referenced by vol_precache_part().
void* BLI_thread_queue_pop_timeout | ( | ThreadQueue * | queue, |
int | ms | ||
) |
Definition at line 623 of file threads.c.
References BLI_gsqueue_is_empty(), BLI_gsqueue_pop(), ThreadQueue< T >::cond, ThreadQueue< T >::mutex, ThreadQueue< T >::nowait, NULL, PIL_check_seconds_timer(), ThreadQueue< T >::queue, and wait_timeout().
Referenced by vol_precache_objectinstance_threads().
void BLI_thread_queue_push | ( | ThreadQueue * | queue, |
void * | work | ||
) |
Definition at line 559 of file threads.c.
References BLI_gsqueue_push(), ThreadQueue< T >::cond, ThreadQueue< T >::mutex, and ThreadQueue< T >::queue.
Referenced by vol_precache_objectinstance_threads(), and vol_precache_part().
int BLI_thread_queue_size | ( | ThreadQueue * | queue | ) |
Definition at line 650 of file threads.c.
References BLI_gsqueue_size(), ThreadQueue< T >::mutex, ThreadQueue< T >::queue, and size().
void BLI_threadapi_init | ( | void | ) |
void BLI_unlock_thread | ( | int | type | ) |
Definition at line 358 of file threads.c.
References _custom1_lock, _image_lock, _movieclip_lock, _nodes_lock, _opengl_lock, _preview_lock, _rcache_lock, _viewer_lock, LOCK_CUSTOM1, LOCK_IMAGE, LOCK_MOVIECLIP, LOCK_NODES, LOCK_OPENGL, LOCK_PREVIEW, LOCK_RCACHE, and LOCK_VIEWER.
Referenced by BKE_image_acquire_ibuf(), BKE_image_release_ibuf(), colorfn(), do_shadow_thread(), envmap_split_ima(), generate_preview(), get_next_bake_face(), GPU_free_unused_buffers(), gpu_queue_image_for_free(), image_mipmap_test(), makeshadowbuf(), movieclip_build_proxy_ibuf(), movieclip_get_postprocessed_ibuf(), node_draw_basis(), node_update_basis(), ntreeShaderExecTree(), ntreeTexExecTree(), occ_build_recursive(), project_bucket_iter_next(), project_paint_face_init(), render_realtime_texture(), save_render_result_tile(), sculpt_undo_push_node(), shade_tface(), sss_add_points(), and threaded_makeshadowbufs().