Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarshan Kadu <darsh7807@gmail.com>2017-09-10 15:41:40 +0300
committerDarshan Kadu <darsh7807@gmail.com>2017-09-10 15:41:40 +0300
commit6594fa1ce02809a275c9cd488fa0223d03d73571 (patch)
tree0bcd95846e1e3b09239126b40ef434ed3dc3a50d /intern/atomic/intern/atomic_ops_ext.h
parentf2017083a19e5c83aadc575625dce0642ffce6c5 (diff)
merged the master branchsoc-2017-vertex_paint
Diffstat (limited to 'intern/atomic/intern/atomic_ops_ext.h')
-rw-r--r--intern/atomic/intern/atomic_ops_ext.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/intern/atomic/intern/atomic_ops_ext.h b/intern/atomic/intern/atomic_ops_ext.h
index b72c94563fc..8d5f2e5dad7 100644
--- a/intern/atomic/intern/atomic_ops_ext.h
+++ b/intern/atomic/intern/atomic_ops_ext.h
@@ -111,6 +111,17 @@ ATOMIC_INLINE size_t atomic_cas_z(size_t *v, size_t old, size_t _new)
#endif
}
+ATOMIC_INLINE size_t atomic_fetch_and_update_max_z(size_t *p, size_t x)
+{
+ size_t prev_value;
+ while((prev_value = *p) < x) {
+ if(atomic_cas_z(p, prev_value, x) == prev_value) {
+ break;
+ }
+ }
+ return prev_value;
+}
+
/******************************************************************************/
/* unsigned operations. */
ATOMIC_INLINE unsigned int atomic_add_and_fetch_u(unsigned int *p, unsigned int x)