}
#define STHREAD_ACCESS(obj) \
- for (bool first = sthread_access_begin(static_cast<void*>(obj), #obj, __FILE__, __LINE__, __FUNCTION__) || true; \
- first; sthread_access_end(static_cast<void*>(obj), #obj, __FILE__, __LINE__, __FUNCTION__), first = false)
+ for (bool first = sthread_access_begin(static_cast<void*>(obj), #obj, __FILE__, __LINE__, __func__) || true; first; \
+ sthread_access_end(static_cast<void*>(obj), #obj, __FILE__, __LINE__, __func__), first = false)
static void thread_code()
{
std::vector<s4u::Link*> CommImpl::get_traversed_links() const
{
- xbt_assert(get_state() != State::WAITING, "You cannot use %s() if your communication is not ready (%s)", __FUNCTION__,
+ xbt_assert(get_state() != State::WAITING, "You cannot use %s() if your communication is not ready (%s)", __func__,
get_state_str());
std::vector<s4u::Link*> vlinks;
XBT_ATTRIB_UNUSED double res = 0;
CommPtr Comm::set_rate(double rate)
{
xbt_assert(state_ == State::INITED, "You cannot use %s() once your communication started (not implemented)",
- __FUNCTION__);
+ __func__);
rate_ = rate;
return this;
}
CommPtr Comm::set_mailbox(Mailbox* mailbox)
{
xbt_assert(state_ == State::INITED, "You cannot use %s() once your communication started (not implemented)",
- __FUNCTION__);
+ __func__);
mailbox_ = mailbox;
return this;
}
CommPtr Comm::set_src_data(void* buff)
{
xbt_assert(state_ == State::INITED, "You cannot use %s() once your communication started (not implemented)",
- __FUNCTION__);
+ __func__);
xbt_assert(dst_buff_ == nullptr, "Cannot set the src and dst buffers at the same time");
src_buff_ = buff;
return this;
CommPtr Comm::set_src_data_size(size_t size)
{
xbt_assert(state_ == State::INITED, "You cannot use %s() once your communication started (not implemented)",
- __FUNCTION__);
+ __func__);
src_buff_size_ = size;
return this;
}
CommPtr Comm::set_src_data(void* buff, size_t size)
{
xbt_assert(state_ == State::INITED, "You cannot use %s() once your communication started (not implemented)",
- __FUNCTION__);
+ __func__);
xbt_assert(dst_buff_ == nullptr, "Cannot set the src and dst buffers at the same time");
src_buff_ = buff;
CommPtr Comm::set_dst_data(void** buff)
{
xbt_assert(state_ == State::INITED, "You cannot use %s() once your communication started (not implemented)",
- __FUNCTION__);
+ __func__);
xbt_assert(src_buff_ == nullptr, "Cannot set the src and dst buffers at the same time");
dst_buff_ = buff;
return this;
CommPtr Comm::set_dst_data(void** buff, size_t size)
{
xbt_assert(state_ == State::INITED, "You cannot use %s() once your communication started (not implemented)",
- __FUNCTION__);
+ __func__);
xbt_assert(src_buff_ == nullptr, "Cannot set the src and dst buffers at the same time");
dst_buff_ = buff;
Comm* Comm::do_start()
{
xbt_assert(get_state() == State::INITED || get_state() == State::STARTING,
- "You cannot use %s() once your communication started (not implemented)", __FUNCTION__);
+ "You cannot use %s() once your communication started (not implemented)", __func__);
auto myself = kernel::actor::ActorImpl::self();
Comm* Comm::detach()
{
xbt_assert(state_ == State::INITED || state_ == State::STARTING,
- "You cannot use %s() once your communication is %s (not implemented)", __FUNCTION__, get_state_str());
+ "You cannot use %s() once your communication is %s (not implemented)", __func__, get_state_str());
xbt_assert(dst_buff_ == nullptr && dst_buff_size_ == 0, "You can only detach sends, not recvs");
detached_ = true;
start();
MessPtr Mess::set_dst_data(void** buff, size_t size)
{
xbt_assert(state_ == State::INITED, "You cannot use %s() once your communication started (not implemented)",
- __FUNCTION__);
+ __func__);
dst_buff_ = buff;
dst_buff_size_ = size;
Mess* Mess::do_start()
{
xbt_assert(get_state() == State::INITED || get_state() == State::STARTING,
- "You cannot use %s() once your message exchange has started (not implemented)", __FUNCTION__);
+ "You cannot use %s() once your message exchange has started (not implemented)", __func__);
auto myself = kernel::actor::ActorImpl::self();
if (myself == sender_) {
if (mutex->mutex == nullptr)
sthread_mutex_init(mutex, nullptr);
- XBT_DEBUG("%s(%p)", __FUNCTION__, mutex);
+ XBT_DEBUG("%s(%p)", __func__, mutex);
static_cast<sg4::Mutex*>(mutex->mutex)->lock();
return 0;
}
if (mutex->mutex == nullptr)
sthread_mutex_init(mutex, nullptr);
- XBT_DEBUG("%s(%p)", __FUNCTION__, mutex);
+ XBT_DEBUG("%s(%p)", __func__, mutex);
if (static_cast<sg4::Mutex*>(mutex->mutex)->try_lock())
return 0;
return EBUSY;
if (mutex->mutex == nullptr)
sthread_mutex_init(mutex, nullptr);
- XBT_DEBUG("%s(%p)", __FUNCTION__, mutex);
+ XBT_DEBUG("%s(%p)", __func__, mutex);
static_cast<sg4::Mutex*>(mutex->mutex)->unlock();
return 0;
}
if (mutex->mutex == nullptr)
sthread_mutex_init(mutex, nullptr);
- XBT_DEBUG("%s(%p)", __FUNCTION__, mutex);
+ XBT_DEBUG("%s(%p)", __func__, mutex);
intrusive_ptr_release(static_cast<sg4::Mutex*>(mutex->mutex));
return 0;
}