Loading...
Searching...
No Matches
LibThread::Transactional Class Reference

## Public Member Functions

| Transactional ()
void | set_region (Region *region_init)
virtual | ~Transactional ()
Public Member Functions inherited from LibThread::SharedObject
| SharedObject ()
virtual | ~SharedObject ()
void | set_type (int type_init)
int | get_type ()
void | set_name (std::string &name_init)
void | set_name (const char *s)
std::string & | get_name ()
void | incref (int by=1)
long | decref ()
long | getref ()
virtual BOOLEAN | op2 (int op, leftv res, leftv a1, leftv a2)
virtual BOOLEAN | op3 (int op, leftv res, leftv a1, leftv a2, leftv a3)

## Protected Member Functions

int | tx_begin ()
void | tx_end ()

## Private Attributes

Region * | region
Lock * | lock

## Detailed Description

Definition at line 281 of file shared.cc.

## Constructor & Destructor Documentation

## Transactional()

LibThread::Transactional::Transactional | ( |  | ) |

inline

Definition at line 301 of file shared.cc.

:
SharedObject(), region(NULL), lock(NULL) {
}
LibThread::SharedObject::SharedObject
SharedObject()
Definition shared.cc:156
LibThread::Transactional::lock
Lock * lock
Definition shared.cc:284
LibThread::Transactional::region
Region * region
Definition shared.cc:283
NULL
#define NULL
Definition omList.c:12

## ~Transactional()

virtual LibThread::Transactional::~Transactional | ( |  | ) |

inline virtual

Definition at line 312 of file shared.cc.

{ if (!region && lock) delete lock; }

## Member Function Documentation

## set_region()

void LibThread::Transactional::set_region | ( | Region * | region_init | ) |

inline

Definition at line 304 of file shared.cc.

{
region = region_init;
if (region_init) {
lock = region_init->get_lock();
} else {
lock = new Lock();
}
}
LibThread::Region::get_lock
Lock * get_lock()
Definition shared.cc:207

## tx_begin()

int LibThread::Transactional::tx_begin | ( |  | ) |

inline protected

Definition at line 286 of file shared.cc.

{
if (!region)
lock->lock();
else {
if (!lock->is_locked()) {
return 0;
}
}
return 1;
}

## tx_end()

void LibThread::Transactional::tx_end | ( |  | ) |

inline protected

Definition at line 296 of file shared.cc.

{
if (!region)
lock->unlock();
}

## Field Documentation

## lock

Lock* LibThread::Transactional::lock

private

Definition at line 284 of file shared.cc.

## region

Region* LibThread::Transactional::region

private

Definition at line 283 of file shared.cc.

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

- Singular/dyn_modules/systhreads/shared.cc