Merging r58073 through r58111 from trunk into soc-2013-depsgraph_mt
[blender.git] / source / blender / blenlib / BLI_threads.h
index ec5581882702ebad1b5bfb25e134afd978ef1ebe..329cc2959ca4808a038ef5ac54f6226058b459e3 100644 (file)
@@ -100,6 +100,7 @@ ThreadMutex *BLI_mutex_alloc(void);
 void BLI_mutex_free(ThreadMutex *mutex);
 
 void BLI_mutex_lock(ThreadMutex *mutex);
+bool BLI_mutex_trylock(ThreadMutex *mutex);
 void BLI_mutex_unlock(ThreadMutex *mutex);
 
 /* Spin Lock */
@@ -182,6 +183,16 @@ int BLI_thread_queue_size(ThreadQueue *queue);
 void BLI_thread_queue_wait_finish(ThreadQueue *queue);
 void BLI_thread_queue_nowait(ThreadQueue *queue);
 
+/* Condition */
+
+typedef pthread_cond_t ThreadCondition;
+
+void BLI_condition_init(ThreadCondition *cond);
+void BLI_condition_wait(ThreadCondition *cond, ThreadMutex *mutex);
+void BLI_condition_notify_one(ThreadCondition *cond);
+void BLI_condition_notify_all(ThreadCondition *cond);
+void BLI_condition_end(ThreadCondition *cond);
+
 /* Thread Local Storage */
 #ifdef _MSC_VER
 #  define ThreadVariable  __declspec(thread)