Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions | Static Public Attributes | Static Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
nsCertVerificationThread Class Reference

#include <nsCertVerificationThread.h>

Inheritance diagram for nsCertVerificationThread:
Inheritance graph
[legend]
Collaboration diagram for nsCertVerificationThread:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsCertVerificationThread ()
 ~nsCertVerificationThread ()
nsresult startThread ()
void requestExit ()

Static Public Member Functions

static nsresult addJob (nsBaseVerificationJob *aJob)

Static Public Attributes

static nsCertVerificationThreadverification_thread_singleton

Static Protected Member Functions

static void PR_CALLBACK nsThreadRunner (void *arg)

Protected Attributes

PRThreadmThreadHandle
PRLockmMutex
PRCondVarmCond
PRBool mExitRequested

Private Member Functions

virtual void Run (void)

Private Attributes

nsDeque mJobQ

Detailed Description

Definition at line 46 of file nsCertVerificationThread.h.


Constructor & Destructor Documentation

Definition at line 95 of file nsCertVerificationThread.cpp.

: mJobQ(nsnull)
{
  NS_ASSERTION(!verification_thread_singleton, 
               "nsCertVerificationThread is a singleton, caller attempts"
               " to create another instance!");
  
  verification_thread_singleton = this;
}

Member Function Documentation

Definition at line 110 of file nsCertVerificationThread.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void PR_CALLBACK nsPSMBackgroundThread::nsThreadRunner ( void arg) [static, protected, inherited]

Definition at line 41 of file nsPSMBackgroundThread.cpp.

Here is the caller graph for this function:

Definition at line 82 of file nsPSMBackgroundThread.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void nsCertVerificationThread::Run ( void  ) [private, virtual]

Implements nsPSMBackgroundThread.

Definition at line 126 of file nsCertVerificationThread.cpp.

{
  while (PR_TRUE) {

    nsBaseVerificationJob *job = nsnull;

    {
      nsAutoLock threadLock(verification_thread_singleton->mMutex);
      
      while (!mExitRequested && (0 == verification_thread_singleton->mJobQ.GetSize())) {
        // no work to do ? let's wait a moment

        PR_WaitCondVar(mCond, PR_INTERVAL_NO_TIMEOUT);
      }
      
      if (mExitRequested)
        break;
      
      job = NS_STATIC_CAST(nsBaseVerificationJob*, mJobQ.PopFront());
    }

    if (job)
    {
      job->Run();
      delete job;
    }
  }
  
  {
    nsAutoLock threadLock(verification_thread_singleton->mMutex);

    while (verification_thread_singleton->mJobQ.GetSize()) {
      nsCertVerificationJob *job = 
        NS_STATIC_CAST(nsCertVerificationJob*, mJobQ.PopFront());
      delete job;
    }
  }
}

Here is the call graph for this function:

Definition at line 57 of file nsPSMBackgroundThread.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

PRCondVar* nsPSMBackgroundThread::mCond [protected, inherited]

Definition at line 60 of file nsPSMBackgroundThread.h.

Definition at line 63 of file nsPSMBackgroundThread.h.

Definition at line 49 of file nsCertVerificationThread.h.

PRLock* nsPSMBackgroundThread::mMutex [protected, inherited]

Definition at line 57 of file nsPSMBackgroundThread.h.

Definition at line 51 of file nsPSMBackgroundThread.h.

Definition at line 57 of file nsCertVerificationThread.h.


The documentation for this class was generated from the following files: