AGENT++  4.0.3
Public Types | Public Member Functions | List of all members
Synchronized Class Reference

The Synchronized class implements services for synchronizing access between different threads. More...

#include <threads.h>

Inheritance diagram for Synchronized:
Request Thread ThreadList ThreadManager MibContext MibEntry RequestList SingleThreadObject MibComplexEntry MibGroup MibLeaf MibProxy MibTable MibStaticTable agentpp_simulation_mib simSysGroup snmp_notification_mib snmp_proxy_mib snmp_target_mib snmpGroup sysGroup VacmMIB agentppSimDeleteRow agentppSimDeleteTableContents agentppSimMode DateAndTime OctetStrMinMax SimMibLeaf SnmpDisplayString snmpEnableAuthenTraps SnmpEngineID snmpInASNParseErrs snmpInBadCommunityNames snmpInBadCommunityUses snmpInBadValues snmpInBadVersions snmpInGenErrs snmpInGetNexts snmpInGetRequests snmpInGetResponses snmpInNoSuchNames snmpInPkts snmpInReadOnlys snmpInSetRequests SnmpInt32MinMax snmpInTooBigs snmpInTotalReqVars snmpInTotalSetVars snmpInTraps snmpOutBadValues snmpOutGenErrs snmpOutGetNexts snmpOutGetRequests snmpOutGetResponses snmpOutNoSuchNames snmpOutPkts snmpOutSetRequests snmpOutTooBigs snmpOutTraps snmpProxyDrops snmpRowStatus snmpSilentDrops SnmpTagList SnmpTagValue snmpTargetAddrParams snmpTargetAddrTAddress snmpTargetAddrTDomain SnmpUnavailableContexts SnmpUnknownContexts StorageType sysObjectID sysORLastChange sysServices sysUpTime TestAndIncr TimeStamp SimMibTable StorageTable TimeStampTable VacmContextTable

Public Types

enum  TryLockResult { LOCKED = 1, BUSY = 0, OWNED = -1 }
 

Public Member Functions

 Synchronized ()
 
 ~Synchronized ()
 
void wait ()
 Causes current thread to wait until another thread invokes the notify() method or the notifyAll() method for this object.
 
bool wait (unsigned long timeout)
 Causes current thread to wait until either another thread invokes the notify() method or the notifyAll() method for this object, or a specified amount of time has elapsed.
 
void notify ()
 Wakes up a single thread that is waiting on this object's monitor.
 
void notify_all ()
 Wakes up all threads that are waiting on this object's monitor.
 
bool lock ()
 Enter a critical section.
 
TryLockResult trylock ()
 Try to enter a critical section.
 
bool unlock ()
 Leave a critical section.
 

Detailed Description

The Synchronized class implements services for synchronizing access between different threads.

Author
Frank Fock
Version
4.0

Member Enumeration Documentation

Enumerator:
LOCKED 
BUSY 
OWNED 

Constructor & Destructor Documentation

Synchronized::Synchronized ( )
Synchronized::~Synchronized ( )

Member Function Documentation

bool Synchronized::lock ( )

Enter a critical section.

If this thread owned this lock already, the call succeeds too (returns TRUE), but there will not be recursive locking. Unlocking will always free the lock.

Returns
TRUE if the attempt was successful, FALSE otherwise.
void Synchronized::notify ( )

Wakes up a single thread that is waiting on this object's monitor.

void Synchronized::notify_all ( )

Wakes up all threads that are waiting on this object's monitor.

TryLockResult Synchronized::trylock ( )

Try to enter a critical section.

If this thread owned this lock already, the call succeeds too (returns TRUE), but there will not be recursive locking. Unlocking will always free the lock.

Returns
LOCKED if there was no lock before and now the calling thread owns the lock; BUSY = if another thread owns the lock; OWNED if the lock is already owned by the calling thread.
bool Synchronized::unlock ( )

Leave a critical section.

If this thread called lock or trylock more than once successfully, this call will nevertheless release the lock (non-recursive locking).

Returns
TRUE if the unlock succeeded, FALSE if there was no lock to unlock.
void Synchronized::wait ( )

Causes current thread to wait until another thread invokes the notify() method or the notifyAll() method for this object.

bool Synchronized::wait ( unsigned long  timeout)

Causes current thread to wait until either another thread invokes the notify() method or the notifyAll() method for this object, or a specified amount of time has elapsed.

Parameters
timeouttimeout in milliseconds.
returnTRUE if timeout occured, FALSE otherwise.

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