~ubuntu-branches/ubuntu/lucid/nspr/lucid-updates

« back to all changes in this revision

Viewing changes to mozilla/nsprpub/pr/src/cplus/rccv.cpp

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2014-09-19 08:25:13 UTC
  • mfrom: (1.2.6)
  • Revision ID: package-import@ubuntu.com-20140919082513-ldt99o79f1yggc7e
Tags: 4.10.7-0ubuntu0.10.04.1
* Update to 4.10.7 to support nss security update.
* Removed unneeded patches:
  - debian/patches/30_config_64bits.patch: no longer needed
  - debian/patches/99_configure.patch: no longer needed
  - debian/patches/CVE-2013-5607.patch: included upstream.
  - debian/patches/CVE-2014-1545.patch: included upstream.
* debian/libnspr4-0d.symbols: updated for new version.
* debian/rules: adjust paths, add --enable-64bit when appropriate.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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/. */
5
 
 
6
 
/*
7
 
** RCCondition - C++ wrapper around NSPR's PRCondVar
8
 
*/
9
 
 
10
 
#include "rccv.h"
11
 
 
12
 
#include <prlog.h>
13
 
#include <prerror.h>
14
 
#include <prcvar.h>
15
 
 
16
 
RCCondition::RCCondition(class RCLock *lock): RCBase()
17
 
{
18
 
    cv = PR_NewCondVar(lock->lock);
19
 
    PR_ASSERT(NULL != cv);
20
 
    timeout = PR_INTERVAL_NO_TIMEOUT;
21
 
}  /* RCCondition::RCCondition */
22
 
 
23
 
RCCondition::~RCCondition()
24
 
{
25
 
    if (NULL != cv) PR_DestroyCondVar(cv);
26
 
}  /* RCCondition::~RCCondition */
27
 
 
28
 
PRStatus RCCondition::Wait()
29
 
{
30
 
    PRStatus rv;
31
 
    PR_ASSERT(NULL != cv);
32
 
    if (NULL == cv)
33
 
    {
34
 
        SetError(PR_INVALID_ARGUMENT_ERROR, 0);
35
 
        rv = PR_FAILURE;
36
 
    }
37
 
    else
38
 
        rv = PR_WaitCondVar(cv, timeout.interval);
39
 
    return rv;
40
 
}  /* RCCondition::Wait */
41
 
 
42
 
PRStatus RCCondition::Notify()
43
 
{
44
 
    return PR_NotifyCondVar(cv);
45
 
}  /* RCCondition::Notify */
46
 
 
47
 
PRStatus RCCondition::Broadcast()
48
 
{
49
 
    return PR_NotifyAllCondVar(cv);
50
 
}  /* RCCondition::Broadcast */
51
 
 
52
 
PRStatus RCCondition::SetTimeout(const RCInterval& tmo)
53
 
{
54
 
    if (NULL == cv)
55
 
    {
56
 
        SetError(PR_INVALID_ARGUMENT_ERROR, 0);
57
 
        return PR_FAILURE;
58
 
    }
59
 
    timeout = tmo;
60
 
    return PR_SUCCESS;
61
 
}  /* RCCondition::SetTimeout */
62
 
 
63
 
RCInterval RCCondition::GetTimeout() const { return timeout; }
64
 
 
65
 
/* rccv.cpp */