Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 /*
7 ** Class: RCMonitor (ref prmonitor.h)
8 **
9 ** RCMonitor.h - C++ wrapper around NSPR's monitors
10 */
11 #if defined(_RCMONITOR_H)
12 #else
13 #define _RCMONITOR_H
15 #include "rcbase.h"
16 #include "rcinrval.h"
18 struct PRMonitor;
20 class PR_IMPLEMENT(RCMonitor): public RCBase
21 {
22 public:
23 RCMonitor(); /* timeout is infinity */
24 virtual ~RCMonitor();
26 virtual void Enter(); /* reentrant entry */
27 virtual void Exit();
29 virtual void Notify(); /* possibly enable one thread */
30 virtual void NotifyAll(); /* enable all waiters */
32 virtual void Wait(); /* applies object's timeout */
34 virtual void SetTimeout(const RCInterval& timeout);
36 private:
37 PRMonitor *monitor;
38 RCInterval timeout;
40 public:
41 RCInterval GetTimeout() const; /* get the current value */
43 }; /* RCMonitor */
45 #endif /* defined(_RCMONITOR_H) */
47 /* RCMonitor.h */