Ticket #5622: syncbug.cc

File syncbug.cc, 423 bytes (added by Horst Schirmeier <horst@…>, 11 years ago)

Code snippet to reproduce the bug

Line 
1#include <iostream>
2#include <boost/interprocess/sync/named_semaphore.hpp>
3
4#ifndef BOOST_INTERPROCESS_NAMED_SEMAPHORE_USES_POSIX_SEMAPHORES
5#error "BOOST_INTERPROCESS_NAMED_SEMAPHORE_USES_POSIX_SEMAPHORES is disabled"
6#endif
7
8int main()
9{
10 // should say "false" if the semaphore "doesntexist" doesn't exist
11 std::cout <<
12 (boost::interprocess::named_semaphore::remove("doesntexist") ?
13 "true" : "false") << std::endl;
14}