示例#1
0
文件: mutex.cpp 项目: qiutaoleo/hpx
    mutex::~mutex()
    {
        HPX_ITT_SYNC_DESTROY(this);
        if (!queue_.empty()) {
            LERR_(fatal) << "lcos::local::mutex::~mutex: " << description_
                         << ": queue is not empty";

            mutex_type::scoped_lock l(mtx_);
            while (!queue_.empty()) {
                threads::thread_id_type id = queue_.front().id_;
                queue_.front().id_ = 0;
                queue_.pop_front();

                // we know that the id is actually the pointer to the thread
                LERR_(fatal) << "lcos::local::mutex::~mutex: " << description_
                    << ": pending thread: "
                    << threads::get_thread_state_name(threads::get_thread_state(id))
                    << "(" << id << "): " << threads::get_thread_description(id);

                // forcefully abort thread, do not throw
                error_code ec(lightweight);
                threads::set_thread_state(id, threads::pending,
                    threads::wait_abort, threads::thread_priority_default, ec);
                if (ec) {
                    LERR_(fatal) << "lcos::local::mutex::~mutex: could not abort thread"
                        << get_thread_state_name(threads::get_thread_state(id))
                        << "(" << id << "): " << threads::get_thread_state(id);
                }
            }
        }
    }
示例#2
0
 itt_spinlock_init<Tag>::~itt_spinlock_init()
 {
     for (int i = 0; i < 41; ++i)
     {
         HPX_ITT_SYNC_DESTROY(&lcos::local::spinlock_pool<Tag>::pool_[i]);
     }
 }
示例#3
0
 ~mutex()
 {
     HPX_ITT_SYNC_DESTROY(this);
 }
示例#4
0
文件: spinlock.hpp 项目: atrantan/hpx
 ~spinlock()
 {
     HPX_ITT_SYNC_DESTROY(this);
 }
示例#5
0
 ~spinlock_no_backoff()
 {
     HPX_ITT_SYNC_DESTROY(this);
 }