JuggerNET Runtime Library v3.6.54.0  3.6.54.0
Public Member Functions | List of all members
Codemesh.JuggerNET.JavaProxyLockHolder Class Reference

Provides access to Java synchronization primitives. By declaring the instance in a using block, the .NET runtime will automatically and safely (in the presence of exceptions) enter and exit a critical section based on the specified Java object. More...

Inheritance diagram for Codemesh.JuggerNET.JavaProxyLockHolder:
Inheritance graph
[legend]
Collaboration diagram for Codemesh.JuggerNET.JavaProxyLockHolder:
Collaboration graph
[legend]

Public Member Functions

 JavaProxyLockHolder (JavaProxy proxy)
 Creates the instance and attempts to enter a critical section on the passed in object. More...
 
void Exit ()
 Releases the critical section that is held on the object. You don't have to call this method explicitly, but you can. It will be called automatically when the object is disposed or garbage collected. More...
 
void Dispose ()
 Exits the monitor. More...
 

Detailed Description

Provides access to Java synchronization primitives. By declaring the instance in a using block, the .NET runtime will automatically and safely (in the presence of exceptions) enter and exit a critical section based on the specified Java object.

Please note that this type does not exit the monitor on object finalization as this would not be compatible with the semantics of the monitor (enter and exit on the same thread).

See also
Codemesh.JuggerNET.JavaProxyMonitor
using( JavaProxyLockHolder jlh = new JavaProxyLockHolder( obj ) )
{
// perform code in thread-safe block
}
See also
Codemesh.JuggerNET.JavaProxyMonitor

Constructor & Destructor Documentation

◆ JavaProxyLockHolder()

Codemesh.JuggerNET.JavaProxyLockHolder.JavaProxyLockHolder ( JavaProxy  proxy)
inline

Creates the instance and attempts to enter a critical section on the passed in object.

Parameters
proxythe object on which a Java lock is to be acquired.

Member Function Documentation

◆ Dispose()

void Codemesh.JuggerNET.JavaProxyLockHolder.Dispose ( )
inline

Exits the monitor.

This function is part of the IDisposable pattern and will typically be used via the using clause.

References Codemesh.JuggerNET.JavaProxyLockHolder.Exit().

◆ Exit()

void Codemesh.JuggerNET.JavaProxyLockHolder.Exit ( )
inline

Releases the critical section that is held on the object. You don't have to call this method explicitly, but you can. It will be called automatically when the object is disposed or garbage collected.

Referenced by Codemesh.JuggerNET.JavaProxyLockHolder.Dispose().


The documentation for this class was generated from the following file:
Codemesh.JuggerNET.JavaProxyLockHolder.JavaProxyLockHolder
JavaProxyLockHolder(JavaProxy proxy)
Creates the instance and attempts to enter a critical section on the passed in object.
Definition: JavaProxyMonitor.cs:79

Copyright (c) 1999-2020 by Codemesh, Inc., ALL RIGHTS RESERVED.