Mercurial > hg > orthanc-stone
comparison Framework/Toolbox/DownloadStack.h @ 53:c2dc924f1a63 wasm
removing threading out of the framework
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 27 Apr 2017 16:57:49 +0200 |
parents | 28956ed68280 |
children | 4a541cd4fa83 |
comparison
equal
deleted
inserted
replaced
52:37e504582af6 | 53:c2dc924f1a63 |
---|---|
21 | 21 |
22 #pragma once | 22 #pragma once |
23 | 23 |
24 #include <vector> | 24 #include <vector> |
25 #include <boost/noncopyable.hpp> | 25 #include <boost/noncopyable.hpp> |
26 #include <boost/thread/mutex.hpp> | 26 |
27 #include <boost/thread/mutex.hpp> // TODO remove | |
27 | 28 |
28 namespace OrthancStone | 29 namespace OrthancStone |
29 { | 30 { |
30 class DownloadStack : public boost::noncopyable | 31 class DownloadStack : public boost::noncopyable |
31 { | 32 { |
38 int next_; | 39 int next_; |
39 int prev_; | 40 int prev_; |
40 bool dequeued_; | 41 bool dequeued_; |
41 }; | 42 }; |
42 | 43 |
43 boost::mutex mutex_; | |
44 std::vector<Node> nodes_; | 44 std::vector<Node> nodes_; |
45 int firstNode_; | 45 int firstNode_; |
46 | 46 |
47 bool CheckInvariants() const; | 47 bool CheckInvariants() const; |
48 | 48 |
61 DownloadStack& that_; | 61 DownloadStack& that_; |
62 boost::mutex::scoped_lock lock_; | 62 boost::mutex::scoped_lock lock_; |
63 | 63 |
64 public: | 64 public: |
65 Writer(DownloadStack& that) : | 65 Writer(DownloadStack& that) : |
66 that_(that), | 66 that_(that) |
67 lock_(that.mutex_) | 67 //lock_(that.mutex_) |
68 { | 68 { |
69 } | 69 } |
70 | 70 |
71 void SetTopNode(unsigned int value); | 71 void SetTopNode(unsigned int value); |
72 | 72 |