hpx/synchronization/mutex.hpp

See Public API for a list of names and headers that are part of the public HPX API.

namespace hpx
class mutex

Subclassed by hpx::timed_mutex

Public Functions

HPX_NON_COPYABLE(mutex)
mutex(char const *const description = "")
~mutex()
void lock(char const *description, error_code &ec = throws)
void lock(error_code &ec = throws)
bool try_lock(char const *description, error_code &ec = throws)
bool try_lock(error_code &ec = throws)
void unlock(error_code &ec = throws)

Protected Types

typedef hpx::spinlock mutex_type

Protected Attributes

mutex_type mtx_
threads::thread_id_type owner_id_
hpx::lcos::local::detail::condition_variable cond_
class timed_mutex : private hpx::mutex

Public Functions

HPX_NON_COPYABLE(timed_mutex)
timed_mutex(char const *const description = "")
~timed_mutex()
bool try_lock_until(hpx::chrono::steady_time_point const &abs_time, char const *description, error_code &ec = throws)
bool try_lock_until(hpx::chrono::steady_time_point const &abs_time, error_code &ec = throws)
bool try_lock_for(hpx::chrono::steady_duration const &rel_time, char const *description, error_code &ec = throws)
bool try_lock_for(hpx::chrono::steady_duration const &rel_time, error_code &ec = throws)
void lock(char const *description, error_code &ec = throws)
void lock(error_code &ec = throws)
bool try_lock(char const *description, error_code &ec = throws)
bool try_lock(error_code &ec = throws)
void unlock(error_code &ec = throws)
namespace threads

Typedefs

using thread_id_ref_type = thread_id_ref
using thread_self = coroutines::detail::coroutine_self

Functions

thread_id get_self_id()

The function get_self_id returns the HPX thread id of the current thread (or zero if the current thread is not a HPX thread).

thread_self *get_self_ptr()

The function get_self_ptr returns a pointer to the (OS thread specific) self reference to the current HPX thread.