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