comparison OrthancFramework/Sources/MultiThreading/Semaphore.h @ 4819:70d2a97ca8cb openssl-3.x

integration mainline->openssl-3.x
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 25 Nov 2021 13:12:32 +0100
parents 4e765c18ace7
children 7053502fbf97
comparison
equal deleted inserted replaced
4785:61da49321754 4819:70d2a97ca8cb
34 private: 34 private:
35 unsigned int availableResources_; 35 unsigned int availableResources_;
36 boost::mutex mutex_; 36 boost::mutex mutex_;
37 boost::condition_variable condition_; 37 boost::condition_variable condition_;
38 38
39 public:
40 explicit Semaphore(unsigned int availableResources);
41
42 unsigned int GetAvailableResourcesCount() const;
43
39 void Release(unsigned int resourceCount = 1); 44 void Release(unsigned int resourceCount = 1);
40 45
41 void Acquire(unsigned int resourceCount = 1); 46 void Acquire(unsigned int resourceCount = 1);
42 47
43 bool TryAcquire(unsigned int resourceCount = 1); 48 bool TryAcquire(unsigned int resourceCount = 1);
44 public:
45 explicit Semaphore(unsigned int availableResources);
46
47 unsigned int GetAvailableResourcesCount() const;
48
49 49
50 class Locker : public boost::noncopyable 50 class Locker : public boost::noncopyable
51 { 51 {
52 private: 52 private:
53 Semaphore& that_; 53 Semaphore& that_;