public:
MutexAcquisitionImpl(actor::ActorImpl* issuer, MutexImpl* mutex) : issuer_(issuer), mutex_(mutex) {}
- MutexImplPtr get_mutex() { return mutex_; }
- actor::ActorImpl* get_issuer() { return issuer_; }
+ MutexImplPtr get_mutex() const { return mutex_; }
+ actor::ActorImpl* get_issuer() const { return issuer_; }
void grant() { granted_ = true; }
- bool is_granted() { return granted_; }
+ bool is_granted() const { return granted_; }
bool test(actor::ActorImpl* issuer = nullptr) override;
void wait_for(actor::ActorImpl* issuer, double timeout) override;
friend MutexAcquisitionImpl;
public:
- MutexImpl(bool recursive = false) : piface_(this), is_recursive_(recursive) {}
+ explicit MutexImpl(bool recursive = false) : piface_(this), is_recursive_(recursive) {}
MutexImpl(MutexImpl const&) = delete;
MutexImpl& operator=(MutexImpl const&) = delete;
{
if (mutex->refcount_.fetch_sub(1) == 1) {
xbt_assert(mutex->ongoing_acquisitions_.empty(), "The destroyed mutex still had ongoing acquisitions");
- xbt_assert(mutex->owner_ == nullptr, "The destroyed mutex is still owned by %s", mutex->owner_->get_cname());
+ xbt_assert(mutex->owner_ == nullptr, "The destroyed mutex is still owned by actor %s",
+ mutex->owner_->get_cname());
delete mutex;
}
}