Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#11817 closed Bugs (fixed)

'sync_queue_is_closed' was not declared in boost/thread/executors/thread_executor.hpp

Reported by: Xiaoshuang LU <luxiaoshuang@…> Owned by: viboes
Milestone: Boost 1.60.0 Component: thread
Version: Boost 1.59.0 Severity: Problem
Keywords: Cc:

Description (last modified by viboes)

boost-1.59.0/include/boost/thread/executors/thread_executor.hpp: In member function 'void boost::executors::thread_executor::submit(void (*)())':
boost-1.59.0/include/boost/thread/executors/thread_executor.hpp:122:68: error: 'sync_queue_is_closed' was not declared in this scope
       if (closed(lk))  BOOST_THROW_EXCEPTION( sync_queue_is_closed() );
                                                                    ^
boost-1.59.0/include/boost/thread/executors/thread_executor.hpp: In member function 'void boost::executors::thread_executor::submit(Closure&&)':
boost-1.59.0/include/boost/thread/executors/thread_executor.hpp:132:68: error: there are no arguments to 'sync_queue_is_closed' that depend on a template parameter, so a declaration of 'sync_queue_is_closed' must be available [-fpermissive]
       if (closed(lk))  BOOST_THROW_EXCEPTION( sync_queue_is_closed() );

Change History (7)

comment:1 by viboes, 7 years ago

Owner: changed from Anthony Williams to viboes
Status: newassigned

comment:2 by Xiaoshuang LU <luxiaoshuang@…>, 7 years ago

Hi Vibose,

Would you mind to assigning this ticket to me? I will take care of it.

Thanks.

Xiaoshuang LU

comment:3 by viboes, 7 years ago

Description: modified (diff)

Hi,

there is a missing

#include <boost/thread/concurrent_queues/queue_op_status.hpp>

comment:4 by viboes, 7 years ago

Milestone: To Be DeterminedBoost 1.60.0
Version: Boost 1.60.0Boost 1.59.0

in reply to:  3 comment:5 by Xiaoshuang LU <luxiaoshuang@…>, 7 years ago

Yes, you are correct.

Replying to viboes:

Hi,

there is a missing

#include <boost/thread/concurrent_queues/queue_op_status.hpp>

comment:6 by viboes, 7 years ago

Resolution: fixed
Status: assignedclosed

comment:7 by tamino@…, 6 years ago

Hello, this bug does still does occur when the order of includes is not correct:

#define BOOST_THREAD_VERSION 4
#define BOOST_THREAD_PROVIDES_EXECUTORS

#include <iostream>
#include <thread>
#include <list>
#include <chrono>

#include <boost/thread.hpp>
#include <boost/thread/future.hpp>
#include <boost/thread/executors/thread_executor.hpp> // include this first which includes queue_op_status.hpp
#include <boost/thread/executors/inline_executor.hpp>
#include <boost/thread/executors/basic_thread_pool.hpp>
#include <boost/thread/executors/loop_executor.hpp>

When I include thread_executor.hpp later I still get this error. I am using Boost 1.63.0 customly build with gcc -std=c++14.

So this version fails:

#define BOOST_THREAD_VERSION 4
#define BOOST_THREAD_PROVIDES_EXECUTORS

#include <iostream>
#include <thread>
#include <list>
#include <chrono>

#include <boost/thread.hpp>
#include <boost/thread/future.hpp>
#include <boost/thread/executors/inline_executor.hpp>
#include <boost/thread/executors/basic_thread_pool.hpp>
#include <boost/thread/executors/loop_executor.hpp>
#include <boost/thread/executors/thread_executor.hpp> // include this first which includes queue_op_status.hpp

with these errors:

/home/tamino/thesis/futures/build/boost/include/boost/thread/executors/inline_executor.hpp: In member function ‘void boost::executors::inline_executor::submit(void (*)())’:
/home/tamino/thesis/futures/build/boost/include/boost/thread/executors/inline_executor.hpp:122:70: error: ‘sync_queue_is_closed’ was not declared in this scope
         if (closed(lk))  BOOST_THROW_EXCEPTION( sync_queue_is_closed() );
                                                                      ^
/home/tamino/thesis/futures/build/boost/include/boost/thread/executors/inline_executor.hpp: In member function ‘void boost::executors::inline_executor::submit(Closure&&)’:
/home/tamino/thesis/futures/build/boost/include/boost/thread/executors/inline_executor.hpp:140:70: error: there are no arguments to ‘sync_queue_is_closed’ that depend on a template parameter, so a declaration of ‘sync_queue_is_closed’ must be available [-fpermissive]
         if (closed(lk))  BOOST_THROW_EXCEPTION( sync_queue_is_closed() );
Note: See TracTickets for help on using tickets.