Repository navigation
threading
A policy that defines the signal/listenable lock_primitive, its storage and the way it is being locked.
namespace threading
{
struct own_recursive_mutex;
struct own_mutex;
struct shared_recursive_mutex;
struct shared_mutex;
struct none;
}
A signal holds an std::recursive_mutex object. This is the default policy because you are not forced to lock the mutex in the calling code if you don't need to protect an external state.
signal::lock_primitive() method returns std::recursive_mutex&.
A signal holds an std::mutex object. You must lock the mutex in the calling code.
signal::lock_primitive() method returns std::mutex&.
A signal holds an std::shared_ptr<std::recursive_mutex> object which should be passed to the signal constructor.
signal::lock_primitive() method returns std::shared_ptr<std::recursive_mutex>.
A signal holds an std::shared_ptr<std::mutex> object which should be passed to the signal constructor. You must lock the mutex in the calling code.
signal::lock_primitive() method returns std::shared_ptr<std::mutex>.
An empty policy. Best for single-threaded signals because it has no overhead.
signal::lock_primitive() method returns void.
struct my_threading
{
using tag = wigwag::threading::tag<wigwag::api_version<2, 0>>;
class lock_primitive
{
public:
unspecified_type get_primitive() const { /*...*/ }
void lock_nonrecursive() const { /*...*/ }
void unlock_nonrecursive() const { /*...*/ }
void lock_recursive() const { /*...*/ }
void unlock_recursive() const { /*...*/ }
};
};using tag = wigwag::threading::tag<wigwag::api_version<2, 0>>;The policy tag. Must be a type alias for wigwag::threading::tag<wigwag::api_version<2, 0>>.
class lock_primitive;A lock_primitive object is stored inside a signal.
unspecified_type get_primitive() const;A getter for the lock primitive. This is the method that is used in signal::lock_primitive().
void lock_nonrecursive() const;This method should lock the lock primitive.
void unlock_nonrecursive() const;See lock_nonrecursive.
void lock_recursive() const;This method should lock the lock primitive if it may be locked recursively. It is invoked from the signal::operator () and may allow a user not to lock the primitive externally if there is no state object associated with the signal.
void unlock_recursive() const;See lock_recursive.