Opened 14 years ago

Closed 14 years ago

#2729 closed Bugs (fixed)

named_condition.hpp does not compile

Reported by: yusuke_mitsuki@… Owned by: Ion Gaztañaga
Milestone: Boost 1.39.0 Component: interprocess
Version: Boost 1.37.0 Severity: Problem
Keywords: Cc:

Description

named_condition::wait() causes the compile error with msvc8.

   namespace ip = boost::interprocess;

    ip::interprocess_mutex mtx;
    ip::named_condition cond(ip::create_only, "Test");
    ip::scoped_lock<ip::interprocess_mutex> lock(mtx);

    cond.wait(lock); // error

Attachments (1)

named_condition.patch (639 bytes ) - added by yusuke_mitsuki@… 14 years ago.

Download all attachments as: .zip

Change History (3)

by yusuke_mitsuki@…, 14 years ago

Attachment: named_condition.patch added

comment:1 by Ion Gaztañaga, 14 years ago

Milestone: Boost 1.38.0Boost 1.39.0

The documentation says:

"A global condition variable that can be created by name. This condition variable is designed to work with named_mutex and can't be placed in shared memory or memory mapped files."

So a named condition variable can't be used with interprocess_mutex. The documentation of wait functions mentions interprocess_mutex so the documentation of those functions is wrong.

comment:2 by Ion Gaztañaga, 14 years ago

Resolution: fixed
Status: newclosed

Fixed documentation and added compile-time static assertion.

Note: See TracTickets for help on using tickets.