Skip to content

Commit

Permalink
Merge pull request dmlc#38 from dmlc/concurrency-fix-for-gcc-4.8
Browse files Browse the repository at this point in the history
[concurrency-fix-for-gcc-4.8] member initialization doesn't work on G++ 4.8
  • Loading branch information
tqchen committed Aug 23, 2015
2 parents cf491a1 + 6259941 commit e52ecde
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions include/dmlc/concurrency.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Spinlock {
template <typename T>
class ConcurrentBlockingQueue {
public:
ConcurrentBlockingQueue() = default;
ConcurrentBlockingQueue();
~ConcurrentBlockingQueue() = default;
/*!
* \brief Push element into the queue.
Expand Down Expand Up @@ -83,7 +83,7 @@ class ConcurrentBlockingQueue {
private:
std::mutex mutex_;
std::condition_variable cv_;
std::atomic<bool> exit_now_{false};
std::atomic<bool> exit_now_;
std::list<T> queue_;
/*!
* \brief Disable copy and move.
Expand All @@ -100,6 +100,9 @@ inline void Spinlock::unlock() noexcept {
lock_.clear(std::memory_order_release);
}

template <typename T>
ConcurrentBlockingQueue<T>::ConcurrentBlockingQueue() : exit_now_{false} {}

template <typename T>
template <typename E>
void ConcurrentBlockingQueue<T>::Push(E&& e) {
Expand Down

0 comments on commit e52ecde

Please sign in to comment.