Skip to content

Commit 4d288ac

Browse files
committed
common/async: fix duplicate definition errors from SharedMutexImpl
the linker complains that several SharedMutexImpl functions are duplicated, if "common/async/shared_mutex.h" is included by more than one translation unit added 'inline' to the function definitions so they're shared instead of duplicated Signed-off-by: Casey Bodley <[email protected]>
1 parent d557013 commit 4d288ac

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/common/async/detail/shared_mutex.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ inline void SharedMutexImpl::lock()
156156
}
157157
}
158158

159-
void SharedMutexImpl::lock(boost::system::error_code& ec)
159+
inline void SharedMutexImpl::lock(boost::system::error_code& ec)
160160
{
161161
std::unique_lock lock{mutex};
162162

@@ -181,7 +181,7 @@ inline bool SharedMutexImpl::try_lock()
181181
return false;
182182
}
183183

184-
void SharedMutexImpl::unlock()
184+
inline void SharedMutexImpl::unlock()
185185
{
186186
RequestList granted;
187187
{
@@ -245,7 +245,7 @@ inline void SharedMutexImpl::lock_shared()
245245
}
246246
}
247247

248-
void SharedMutexImpl::lock_shared(boost::system::error_code& ec)
248+
inline void SharedMutexImpl::lock_shared(boost::system::error_code& ec)
249249
{
250250
std::unique_lock lock{mutex};
251251

@@ -303,8 +303,8 @@ inline void SharedMutexImpl::cancel()
303303
complete(std::move(canceled), boost::asio::error::operation_aborted);
304304
}
305305

306-
void SharedMutexImpl::complete(RequestList&& requests,
307-
boost::system::error_code ec)
306+
inline void SharedMutexImpl::complete(RequestList&& requests,
307+
boost::system::error_code ec)
308308
{
309309
while (!requests.empty()) {
310310
auto& request = requests.front();

0 commit comments

Comments
 (0)