Repository navigation
threading
namespace threading
{
struct own_recursive_mutex;
struct own_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, otherwise an exception is thrown.
signal::lock_primitive() method returns std::mutex&.
An empty policy. Best for single-threaded signals because it has no overhead.
signal::lock_primitive() method returns void.
struct my_threading
{
class lock_primitive
{
public:
void get_primitive() const { /*...*/ }
void lock_connect() const { /*...*/ }
void unlock_connect() const { /*...*/ }
void lock_invoke() const { /*...*/ }
void unlock_invoke() const { /*...*/ }
};
};unspecified_type& get_primitive() const;A getter for the lock primitive. This is the method that is used in signal::lock_primitive().
void lock_connect() const;This method is used when connecting to and disconnecting from a signal. The handlers collection is modified while holding the lock.
void unlock_connect() const;See lock_connect.
void lock_invoke() const;This method is used when invoking a signal. The handlers collection is copied to a temporary container while holding the lock.
void unlock_invoke() const;See lock_invoke.