diff options
author | Marek Olšák <[email protected]> | 2019-09-25 21:22:45 -0400 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2019-10-07 20:04:49 -0400 |
commit | 59dd4dafb5fea8a76e43d1280650b087809945a1 (patch) | |
tree | e987a1a6264fd589d0a40d5b0955c8346174aec7 /src | |
parent | 3b2b83924e3185ba635739667aea849ad6869efb (diff) |
util: use simple_mtx_t for util_range
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/auxiliary/util/u_range.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gallium/auxiliary/util/u_range.h b/src/gallium/auxiliary/util/u_range.h index cbf855a2c57..66faa10a991 100644 --- a/src/gallium/auxiliary/util/u_range.h +++ b/src/gallium/auxiliary/util/u_range.h @@ -37,13 +37,14 @@ #include "os/os_thread.h" #include "util/u_math.h" +#include "util/simple_mtx.h" struct util_range { unsigned start; /* inclusive */ unsigned end; /* exclusive */ /* for the range to be consistent with multiple contexts: */ - mtx_t write_mutex; + simple_mtx_t write_mutex; }; @@ -59,10 +60,10 @@ static inline void util_range_add(struct util_range *range, unsigned start, unsigned end) { if (start < range->start || end > range->end) { - mtx_lock(&range->write_mutex); + simple_mtx_lock(&range->write_mutex); range->start = MIN2(start, range->start); range->end = MAX2(end, range->end); - mtx_unlock(&range->write_mutex); + simple_mtx_unlock(&range->write_mutex); } } @@ -79,14 +80,14 @@ util_ranges_intersect(const struct util_range *range, static inline void util_range_init(struct util_range *range) { - (void) mtx_init(&range->write_mutex, mtx_plain); + (void) simple_mtx_init(&range->write_mutex, mtx_plain); util_range_set_empty(range); } static inline void util_range_destroy(struct util_range *range) { - mtx_destroy(&range->write_mutex); + simple_mtx_destroy(&range->write_mutex); } #endif |