Ice 3.7 C++98 API Reference
Loading...
Searching...
No Matches
CountDownLatch.h
Go to the documentation of this file.
1//
2// Copyright (c) ZeroC, Inc. All rights reserved.
3//
4
5#ifndef ICE_UTIL_COUNT_DOWN_LATCH_H
6#define ICE_UTIL_COUNT_DOWN_LATCH_H
7
8#include <IceUtil/Config.h>
9
10namespace IceUtilInternal
11{
12
13//
14// See java.util.concurrent.CountDownLatch in Java 1.5
15//
16
17class ICE_API CountDownLatch
18{
19public:
20
21 CountDownLatch(int);
22 ~CountDownLatch();
23
24 void await() const;
25 void countDown();
26 int getCount() const;
27
28private:
29
30#ifdef _WIN32
31 mutable LONG _count;
32 HANDLE _event;
33#else
34 int _count;
35 mutable pthread_mutex_t _mutex;
36 mutable pthread_cond_t _cond;
37
38 inline void lock() const;
39 inline void unlock() const;
40#endif
41};
42
43}
44
45#endif
#define ICE_API
Definition Config.h:197