Add C++ wrappers for pthread mutex and rcu read lock
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 5 May 2022 19:16:53 +0000 (15:16 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 13 Jun 2022 20:34:46 +0000 (16:34 -0400)
commit0a325f4dec3f6d553dad5d2c26ebfdc78201c363
tree4fe59e66d96f10128a10b65f22c5f9e63917ac86
parent332a2147fece4548eac38a0929b208230a8da31f
Add C++ wrappers for pthread mutex and rcu read lock

Add two wrappers that are similar and provide the "Mutex" named
requirements[1] around pthread_mutex_t and liburcu's RCU reader lock.

In both cases, the intention is to either use the `mutex` or `read_lock`
interface with the standard concurrency support library (e.g. std::lock,
etc.) or, more likely, use the lock_guard wrappers.

The lock_guard[2] wrappers make it easier to convert existing code to be
exception-safe and generally makes the use of those locks less
error-prone.

[1] https://en.cppreference.com/w/cpp/named_req/Mutex
[2] https://en.cppreference.com/w/cpp/thread/lock_guard

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I26cfc2e954d1d4cc1f7e0973cdcd1b9881ef181a
src/common/Makefile.am
src/common/pthread-lock.hpp [new file with mode: 0644]
src/common/urcu.hpp [new file with mode: 0644]
This page took 0.025359 seconds and 4 git commands to generate.