0
我想知道std::thread::join
是在libcxx中實現的。雖然它在<thread>
標題中聲明,但似乎沒有定義。我甚至看過libcxxabi,但在那裏也找不到它。在libcxx中實現的std :: thread :: join在哪裏
那麼有人可能會指出它在哪裏實施?
我想知道std::thread::join
是在libcxx中實現的。雖然它在<thread>
標題中聲明,但似乎沒有定義。我甚至看過libcxxabi,但在那裏也找不到它。在libcxx中實現的std :: thread :: join在哪裏
那麼有人可能會指出它在哪裏實施?
它在src/thread.cpp,靠近頂部:
void
thread::join()
{
int ec = pthread_join(__t_, 0);
#ifndef _LIBCPP_NO_EXCEPTIONS
if (ec)
throw system_error(error_code(ec, system_category()), "thread::join failed");
#else
(void)ec;
#endif // _LIBCPP_NO_EXCEPTIONS
__t_ = 0;
}
並非所有的功能在頭文件中定義,他們可能會在鏈接時庫來實現。 – 2013-03-28 10:14:27
src/thread.cpp在一開始。 – inf 2013-03-28 10:17:53
@bamboon,謝謝。期待它在標題中。 – abergmeier 2013-03-28 10:25:19