diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2024-09-05 11:10:17 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2024-09-05 11:10:17 -0400 |
commit | 9830f56b1b9d6afc6adfcc3ee3fbd540da9f1737 (patch) | |
tree | bace5ad88877f8a6aaa26d5d623fe0da322a88cf /indra | |
parent | 866f900a3be8bbbf8fb10e6ccb87bb80882b4a6e (diff) |
In llcoromutex.h, pull in llcoro::RMutex from develop branch.
Also add develop branch's comments about llcoro::LockType being deprecated.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llcommon/llcoromutex.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/indra/llcommon/llcoromutex.h b/indra/llcommon/llcoromutex.h index 3405e79478..c0ceac4b22 100644 --- a/indra/llcommon/llcoromutex.h +++ b/indra/llcommon/llcoromutex.h @@ -18,11 +18,13 @@ // e.g. #include LLCOROS_MUTEX_HEADER #define LLCOROS_MUTEX_HEADER <boost/fiber/mutex.hpp> +#define LLCOROS_RMUTEX_HEADER <boost/fiber/recursive_mutex.hpp> #define LLCOROS_CONDVAR_HEADER <boost/fiber/condition_variable.hpp> namespace boost { namespace fibers { class mutex; + class recursive_mutex; enum class cv_status; class condition_variable; } @@ -47,6 +49,12 @@ static Future<T> getFuture(Promise<T>& promise) { return promise.get_future(); } // use mutex, lock, condition_variable suitable for coroutines using Mutex = boost::fibers::mutex; +using RMutex = boost::fibers::recursive_mutex; +// With C++17, LockType is deprecated: at this point we can directly +// declare 'std::unique_lock lk(some_mutex)' without explicitly stating +// the mutex type. Sadly, making LockType an alias template for +// std::unique_lock doesn't work the same way: Class Template Argument +// Deduction only works for class templates, not alias templates. using LockType = std::unique_lock<Mutex>; using cv_status = boost::fibers::cv_status; using ConditionVariable = boost::fibers::condition_variable; |