From 9830f56b1b9d6afc6adfcc3ee3fbd540da9f1737 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 5 Sep 2024 11:10:17 -0400 Subject: In llcoromutex.h, pull in llcoro::RMutex from develop branch. Also add develop branch's comments about llcoro::LockType being deprecated. --- indra/llcommon/llcoromutex.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'indra/llcommon') 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 +#define LLCOROS_RMUTEX_HEADER #define LLCOROS_CONDVAR_HEADER namespace boost { namespace fibers { class mutex; + class recursive_mutex; enum class cv_status; class condition_variable; } @@ -47,6 +49,12 @@ static Future getFuture(Promise& 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; using cv_status = boost::fibers::cv_status; using ConditionVariable = boost::fibers::condition_variable; -- cgit v1.2.3