nsprpub/pr/src/cplus/rcmon.h

Wed, 31 Dec 2014 06:55:46 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:46 +0100
changeset 1
ca08bd8f51b2
permissions
-rw-r--r--

Added tag TORBROWSER_REPLICA for changeset 6474c204b198

     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 */

mercurial