Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#8008 closed Bugs (duplicate)

boost named_condition under Windows

Reported by: mdellerus@… Owned by: Ion Gaztañaga
Milestone: To Be Determined Component: interprocess
Version: Boost 1.52.0 Severity: Problem
Keywords: Cc:

Description

Simple problem, reduced to it's simplest form.

NamedConditionServer.cpp

#include <boost/interprocess/sync/named_mutex.hpp>
#include <boost/interprocess/sync/named_condition.hpp>
namespace ipc = boost::interprocess;
int main()
{
  unsigned long long count = 0;
  ipc::named_mutex     myMutex( ipc::open_or_create, "BoostConditionTestMutex" );
  ipc::named_condition myCondition( ipc::open_or_create, "BoostConditionTestCondition" );
  ipc::scoped_lock<ipc::named_mutex> lock( myMutex );
  for(;;)
  {
    myCondition.wait( lock );
    std::cout << "Served # " << ++count << std::endl;
  }
  return 0;
}

NamedConditionClient.cpp

#include <boost/interprocess/sync/named_mutex.hpp>
#include <boost/interprocess/sync/named_condition.hpp>
namespace ipc = boost::interprocess;
int main()
{
  ipc::named_condition myCondition( ipc::open_or_create, "BoostConditionTestCondition" );
  myCondition.notify_one();
}

Under Linux, I can run the server in another window or the background and it responds as expected when I run the client.

On Windows7 (Visual Studio 2012 Update 1) however, the server never wakes up from the "wait".

I have tried under the debugger and have removed "C:\ProgramData\boost_interprocess" between runs to no avail.

After running, there is just one "BoostConditionTestCondition" and just one "BoostConditionTestMutex" file in the "C:\ProgramData\boost_interprocess" tree.

This appears to be a bug to me, but I'd welcome suggestions to the contrary.

Change History (4)

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

Resolution: duplicate
Status: newclosed

thanks for the report and specially the test case. It's a bug and it's a duplicate of #7682

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

#7682 fixed, can you test if your bug was fixed?

in reply to:  2 comment:3 by anonymous, 10 years ago

Replying to igaztanaga:

#7682 fixed, can you test if your bug was fixed?

Thanks!

It's a bug from work and I don't have the resources at home to do that. I will check on Monday US Pacific time, but it's a simple test that I'm sure someone else will probably have already run by then.

comment:4 by anonymous, 10 years ago

Both Linux and Windows are working using SVN Revision 82818.

Note: See TracTickets for help on using tickets.