bloomberg / quantum

Powerful multi-threaded coroutine dispatcher and parallel execution engine
Apache License 2.0
579 stars 95 forks source link

Tests fail: error: call to deleted constructor of 'Bloomberg::quantum::SpinLock' #151

Open yurivict opened 3 years ago

yurivict commented 3 years ago

Describe the bug

In file included from /disk-samsung/freebsd-ports/devel/quantum/work/quantum-2.2/quantum/quantum_dispatcher_core.h:20:
/disk-samsung/freebsd-ports/devel/quantum/work/quantum-2.2/quantum/quantum_task_queue.h:59:5: error: call to deleted constructor of 'Bloomberg::quantum::SpinLock'
    TaskQueue(TaskQueue&& other) = default;
    ^~~~~~~~~
/usr/include/c++/v1/memory:1809:31: note: in defaulted move constructor for 'Bloomberg::quantum::TaskQueue' first required here
            ::new((void*)__p) _Up(_VSTD::forward<_Args>(__args)...);
                              ^
/usr/include/c++/v1/memory:1687:21: note: in instantiation of function template specialization 'std::__1::allocator<Bloomberg::quantum::TaskQueue>::construct<Bloomberg::quantum::TaskQueue, Bloomberg::quantum::TaskQueue>' requested here
                __a.construct(__p, _VSTD::forward<_Args>(__args)...);
                    ^
/usr/include/c++/v1/memory:1538:14: note: in instantiation of function template specialization 'std::__1::allocator_traits<std::__1::allocator<Bloomberg::quantum::TaskQueue>>::__construct<Bloomberg::quantum::TaskQueue, Bloomberg::quantum::TaskQueue>' requested here
            {__construct(__has_construct<allocator_type, _Tp*, _Args...>(),
             ^
/usr/include/c++/v1/memory:1638:15: note: in instantiation of function template specialization 'std::__1::allocator_traits<std::__1::allocator<Bloomberg::quantum::TaskQueue>>::construct<Bloomberg::quantum::TaskQueue, Bloomberg::quantum::TaskQueue>' requested here
              construct(__a, _VSTD::__to_address(__end2 - 1),
              ^
/usr/include/c++/v1/vector:954:21: note: in instantiation of function template specialization 'std::__1::allocator_traits<std::__1::allocator<Bloomberg::quantum::TaskQueue>>::__construct_backward_with_exception_guarantees<Bloomberg::quantum::TaskQueue *>' requested here
    __alloc_traits::__construct_backward_with_exception_guarantees(
                    ^
/usr/include/c++/v1/vector:1591:9: note: in instantiation of member function 'std::__1::vector<Bloomberg::quantum::TaskQueue, std::__1::allocator<Bloomberg::quantum::TaskQueue>>::__swap_out_circular_buffer' requested here
        __swap_out_circular_buffer(__v);
        ^
/disk-samsung/freebsd-ports/devel/quantum/work/quantum-2.2/quantum/impl/quantum_dispatcher_core_impl.h:57:17: note: in instantiation of member function 'std::__1::vector<Bloomberg::quantum::TaskQueue, std::__1::allocator<Bloomberg::quantum::TaskQueue>>::reserve' requested here
    _coroQueues.reserve(coroCount);
                ^
/disk-samsung/freebsd-ports/devel/quantum/work/quantum-2.2/quantum/quantum_spinlock.h:39:5: note: 'SpinLock' has been explicitly marked deleted here
    SpinLock(const SpinLock&) = delete;
    ^

Version 2.2 clang-11 OS: FreeBSD 13

accelerated commented 3 years ago

Hi @yurivict see here for a possible workaround in the meantime #150 until this gets fixed

safaruqi commented 3 years ago

Hi @yurivict Please try the change in this pull request. We will merge if this fixes the issue. https://github.com/bloomberg/quantum/pull/152