Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Attributes
NativeMonitor Class Reference

#include <NativeMonitor.h>

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

List of all members.

Public Member Functions

 NativeMonitor (MRJSession *session, nsIThreadManager *manager, void *address=NULL)
virtual ~NativeMonitor ()
virtual void enter ()
virtual void exit ()
virtual void wait ()
virtual void wait (long long millis)
virtual void notify ()
virtual void notifyAll ()
 NativeMonitor (MRJSession *session, nsIThreadManager *manager, void *address=0)
virtual ~NativeMonitor ()
virtual void enter ()
virtual void exit ()
virtual void wait ()
virtual void wait (long long millis)
virtual void notify ()
virtual void notifyAll ()

Private Attributes

MRJSessionmSession
nsIThreadManagermManager
voidmAddress

Detailed Description

Definition at line 50 of file NativeMonitor.h.


Constructor & Destructor Documentation

NativeMonitor::NativeMonitor ( MRJSession session,
nsIThreadManager manager,
void address = NULL 
)

Definition at line 49 of file NativeMonitor.cpp.

       :      mSession(session), mManager(manager), mAddress(address)
{
       if (address == NULL)
              mAddress = this;
}

Definition at line 56 of file NativeMonitor.cpp.

{}
NativeMonitor::NativeMonitor ( MRJSession session,
nsIThreadManager manager,
void address = 0 
)
virtual NativeMonitor::~NativeMonitor ( ) [virtual]

Member Function Documentation

void NativeMonitor::enter ( ) [virtual]

Implements Monitor.

Definition at line 58 of file NativeMonitor.cpp.

Here is the call graph for this function:

virtual void NativeMonitor::enter ( ) [virtual]

Implements Monitor.

void NativeMonitor::exit ( ) [virtual]

Implements Monitor.

Definition at line 63 of file NativeMonitor.cpp.

Here is the call graph for this function:

virtual void NativeMonitor::exit ( ) [virtual]

Implements Monitor.

void NativeMonitor::notify ( ) [virtual]

Implements Monitor.

Definition at line 92 of file NativeMonitor.cpp.

Here is the call graph for this function:

virtual void NativeMonitor::notify ( ) [virtual]

Implements Monitor.

Implements Monitor.

Definition at line 100 of file NativeMonitor.cpp.

Here is the call graph for this function:

virtual void NativeMonitor::notifyAll ( ) [virtual]

Implements Monitor.

void NativeMonitor::wait ( ) [virtual]

Implements Monitor.

Definition at line 68 of file NativeMonitor.cpp.

{
       // this is weird hackery, but we don't want to let the VM be reentered while we wait on a native monitor.
       Boolean inJavaThread = (mSession->getMainEnv() != mSession->getCurrentEnv());
       if (inJavaThread)
              mSession->lock();

       if (mManager->EnterMonitor(mAddress) == NS_OK) {
              mManager->Wait(mAddress);
              mManager->ExitMonitor(mAddress);
       }

       if (inJavaThread)
              mSession->unlock();
}

Here is the call graph for this function:

virtual void NativeMonitor::wait ( ) [virtual]

Implements Monitor.

void NativeMonitor::wait ( long long  millis) [virtual]

Implements Monitor.

Definition at line 84 of file NativeMonitor.cpp.

Here is the call graph for this function:

virtual void NativeMonitor::wait ( long long  millis) [virtual]

Implements Monitor.


Member Data Documentation

Definition at line 66 of file NativeMonitor.h.

Definition at line 65 of file NativeMonitor.h.

Definition at line 64 of file NativeMonitor.h.


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