[cfe-dev] Possible noncompliance in libc++ std::thread::join()

Gordon Henriksen gordonhenriksen at me.com
Sun Dec 16 14:50:40 PST 2012


This test fails with libc++ std::thread. Is libc++ or the test in error?

  TEST(ThreadTests, InvalidNullJoin) {
    error_code ec;
    try {
      thread().join();
    } catch (system_error &se) {
      ec = se.code();
    }
    EXPECT_EQ(ec, errc::invalid_argument); // no_such_process w/ libc++
  }

N3242 §30.3.1.5 reads:

    void join();
    ...

    Error conditions:

      — resource_deadlock_would_occur — if deadlock is detected or
        this->get_id() == std::this_thread::get_id().

      - no_such_process — if the thread is not valid.

      - invalid_argument — if the thread is not joinable.

— Gordon





More information about the cfe-dev mailing list