19#define BLENDER_MAX_THREADS 1024
35void BLI_threadpool_init(ListBaseT<ThreadSlot> *threadbase,
void *(*do_thread)(
void *),
int tot);
82#define BLI_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
104#elif defined(__APPLE__)
106#elif defined(_MSC_VER)
107typedef volatile unsigned int SpinLock;
119#define THREAD_LOCK_READ 1
120#define THREAD_LOCK_WRITE 2
122#define BLI_RWLOCK_INITIALIZER PTHREAD_RWLOCK_INITIALIZER
240#if defined(__APPLE__)
241# define ThreadLocal(type) pthread_key_t
242# define BLI_thread_local_create(name) pthread_key_create(&name, NULL)
243# define BLI_thread_local_delete(name) pthread_key_delete(name)
244# define BLI_thread_local_get(name) pthread_getspecific(name)
245# define BLI_thread_local_set(name, value) pthread_setspecific(name, value)
248# define ThreadLocal(type) __declspec(thread) type
250# define ThreadLocal(type) __thread type
252# define BLI_thread_local_create(name)
253# define BLI_thread_local_delete(name)
254# define BLI_thread_local_get(name) name
255# define BLI_thread_local_set(name, value) name = value
unsigned long long int uint64_t
void BLI_thread_queue_nowait(ThreadQueue *queue)
int BLI_available_threads(ListBaseT< ThreadSlot > *threadbase)
void BLI_threadapi_exit()
void BLI_ticket_mutex_lock(TicketMutex *ticket)
@ BLI_THREAD_QUEUE_WORK_PRIORITY_HIGH
@ BLI_THREAD_QUEUE_WORK_PRIORITY_NORMAL
@ BLI_THREAD_QUEUE_WORK_PRIORITY_LOW
pthread_spinlock_t SpinLock
void BLI_condition_init(ThreadCondition *cond)
void * BLI_thread_queue_pop_timeout(ThreadQueue *queue, int ms)
ThreadRWMutex * BLI_rw_mutex_alloc()
bool BLI_mutex_trylock(ThreadMutex *mutex)
bool BLI_thread_queue_cancel_work(ThreadQueue *queue, uint64_t work_id)
void BLI_mutex_unlock(ThreadMutex *mutex)
void BLI_rw_mutex_free(ThreadRWMutex *mutex)
void BLI_thread_queue_wait_finish(ThreadQueue *queue)
void BLI_threadpool_insert(ListBaseT< ThreadSlot > *threadbase, void *callerdata)
void BLI_system_num_threads_override_set(int num)
bool BLI_thread_queue_is_empty(ThreadQueue *queue)
void BLI_threadpool_end(ListBaseT< ThreadSlot > *threadbase)
int BLI_threadpool_available_thread_index(ListBaseT< ThreadSlot > *threadbase)
ThreadMutex * BLI_mutex_alloc()
void BLI_condition_wait(ThreadCondition *cond, ThreadMutex *mutex)
void BLI_rw_mutex_lock(ThreadRWMutex *mutex, int mode)
void BLI_threadapi_init()
void BLI_rw_mutex_init(ThreadRWMutex *mutex)
void BLI_condition_end(ThreadCondition *cond)
int BLI_system_thread_count()
void BLI_condition_notify_one(ThreadCondition *cond)
void BLI_spin_end(SpinLock *spin)
void BLI_mutex_lock(ThreadMutex *mutex)
void BLI_rw_mutex_unlock(ThreadRWMutex *mutex)
void BLI_condition_wait_global_mutex(ThreadCondition *cond, int type)
TicketMutex * BLI_ticket_mutex_alloc()
void BLI_ticket_mutex_free(TicketMutex *ticket)
void BLI_thread_queue_free(ThreadQueue *queue)
ThreadQueue * BLI_thread_queue_init()
ATTR_WARN_UNUSED_RESULT const size_t num
void * BLI_thread_queue_pop(ThreadQueue *queue)
void BLI_threadpool_remove(ListBaseT< ThreadSlot > *threadbase, void *callerdata)
void BLI_mutex_end(ThreadMutex *mutex)
void BLI_condition_notify_all(ThreadCondition *cond)
void BLI_ticket_mutex_unlock(TicketMutex *ticket)
void BLI_rw_mutex_end(ThreadRWMutex *mutex)
void BLI_spin_unlock(SpinLock *spin)
void BLI_spin_init(SpinLock *spin)
void BLI_mutex_free(ThreadMutex *mutex)
int BLI_system_num_threads_override_get()
pthread_cond_t ThreadCondition
pthread_mutex_t ThreadMutex
int BLI_thread_queue_len(ThreadQueue *queue)
bool BLI_ticket_mutex_lock_check_recursive(TicketMutex *ticket)
void BLI_thread_unlock(int type)
uint64_t BLI_thread_queue_push(ThreadQueue *queue, void *work, ThreadQueueWorkPriority priority)
pthread_rwlock_t ThreadRWMutex
void BLI_spin_lock(SpinLock *spin)
void BLI_threadpool_remove_index(ListBaseT< ThreadSlot > *threadbase, int index)
void BLI_mutex_init(ThreadMutex *mutex)
void BLI_threadpool_init(ListBaseT< ThreadSlot > *threadbase, void *(*do_thread)(void *), int tot)
void BLI_thread_lock(int type)
void BLI_threadpool_clear(ListBaseT< ThreadSlot > *threadbase)