AURobotServers  4
Public Member Functions | Private Attributes | List of all members
ULock Class Reference

#include <ulock.h>

Inheritance diagram for ULock:
Inheritance graph

Public Member Functions

bool lock ()
 
void lockInit ()
 
void post ()
 
bool tryLock ()
 
bool tryWait ()
 
 ULock ()
 
void unlock ()
 
bool wait ()
 
 ~ULock ()
 

Private Attributes

pthread_mutex_t mLock
 

Detailed Description

Just a pthread mutex lock packed in a class, to be used e.g. when another class needs lock protection.

Author
Christian Andersen

Constructor & Destructor Documentation

ULock::ULock ( )

Constructor

References lockInit().

ULock::~ULock ( )

Destructor

References mLock.

Member Function Documentation

bool ULock::lock ( )
inline

semaphore lock for this image.

References mLock.

Referenced by UResPcp::add(), UResPoly::add(), USFPool::addData(), UFeaturePool::addData(), UClientHandler::addFunction(), UMsgQueue::addMessage(), UObstacleGroupLaser::addObstPoly(), UObj3dGroup::addObstPoly(), UPoseHistNotUsed::addPoseHist(), UResPoseHist::addPoseHist(), UServerPushImplement::addPushWatch(), ULineMatch::addToPoly(), UFuncKinect::callGotNewDataWithObject(), UResV360::callGotNewDataWithObject(), ULaserDevice::callGotNewDataWithObject(), USick::changeMode(), UGpsLatLong::clear(), UCamPwc::closeDevice(), ULogFile::closeLog(), UResPoseHist::closeLogfile(), ULms100::closePort(), ULms500::closePort(), UHokuyo::closePort(), UFuncLoca2::correlateLines(), UVarPool::createFunctionStack(), UVarPool::createVarPoolStack(), UVarPool::createVarStack(), ULms100::decodeData(), ULms500::decodeData(), UFuncKinect::decodeReplayLine(), UImagePool::decodeReplayLine(), UResPcp::del(), UResPoly::del(), UResKeep::deleteKeep(), UCamPwc::deviceExist(), UFuncGndAna::doAnalysis(), UFuncFz::doClassify(), UNamedBoxes::doDetect(), ULogFile::doFlush(), UClientHandler::doTimeTick(), UResRoadDrive::driveSide(), UCmdExe::executePushFunction(), UCamPool::findDevices(), UResAuEf::findFeatures(), UResAvoid::findPathToHere(), UAvoidPathPool::findPathToHere(), UAvoidPathPool::findPathToHere2(), UCamPwc::getBrightness(), UCamPwc::getColour(), UCamPwc::getCompPref(), UCamPwc::getContour(), UCamPwc::getContrast(), UCamPwc::getGain(), UCamPwc::getGamma(), UPoseHistNotUsed::getHistHeading(), UResPoseHist::getHistHeading(), UResDrivePos::getManLocked(), UResRoadDrive::getManLocked(), UResV360::getMeasurementCnt(), UHokuyo::getNameFromDevice(), ULaserSim::getNewestData(), UReplayDevice::getNewestData(), ULms100::getNewestData(), ULms500::getNewestData(), UHokuyo::getNewestData(), UResV360::getNewestData(), USmlTag::getObstacleGroup(), UPoseHistNotUsed::getOldest(), UResPoseHist::getOldest(), UPoseHistNotUsed::getPoseFitAtDistance(), UResPoseHist::getPoseFitAtDistance(), UPoseHistNotUsed::getPoseNearDistance(), UResPoseHist::getPoseNearDistance(), UPoseHistNotUsed::getPoseNearTime(), UResPoseHist::getPoseNearTime(), UPoseHistNotUsed::getTimeAtDistance(), UResPoseHist::getTimeAtDistance(), UCamPwc::getWhiteBalance(), UFuncKinect::GetXYZCoordinates(), UClientHandler::gotNewData(), UResSmrIf::gotUserEvent(), UFunctionAvoid::handleAvoid(), UClientCamData::handleCamGet(), UFuncObj3d::handleCloud(), UFuncLobst::handleCommand(), UFuncPcp::handleCommand(), UFuncLinefinder::handleCommand(), UFunctionCamGmk::handleGmkGetCommand(), UClientFuncSimScan::handleLaserScan(), UFuncLocalize::handleLocalize(), UResPcp::handleNewData(), UClientFuncObstGrp::handleObst(), UCmdExe::handleOneMessageFromQueue(), UCmdExe::handleOneServerPushMessage(), UClientFuncPath::handlePathPolygonData(), UFuncStereo::handleStereo(), UResSmrCtl::implementDrivePath(), UResLaserIfObst::listGroup(), UResLaserIfObst::listGroups(), UResLocater::locate(), UProbPolyQueue::lockNextIn(), UProbPolyQueue::lockNextOut(), UResLink::lockPoseHist(), UServerClient::logClose(), UResVarPool::logFileClose(), UResVarPool::logFileOpen(), UImageLog::logImage(), UFuncPTgrey::logImageToFile(), UFuncKinect::logImageToFile(), UFuncTOF::logImageToFile(), ULogFile::logLock(), UServerClient::logWrite(), UCamPool::makeDevice(), UFuncBall::makeDisplayPolygon(), UFuncImSeg::makeDisplayPolygon(), UFuncKinect::makeObj3Dcloud(), UFuncKinect::makePCD(), UResLocater::match_points(), UResLaserIfObst::methodCall(), UResLobst::methodCallV(), UResCamIfGmk::newDataAvailable(), UCamPwc::openDevice(), UCamPwc::openDeviceDefault(), ULogFile::openLog(), UImageLog::openLog(), UResAuEf::openLog(), UResGps::openLogfile(), UHokuyo::openPort(), UNavPaint::paint(), UPaintPoseHist::paint(), UFuncFz::paintColoredImage(), UCamPanTiltDevice::pantiltSetPosition(), UCamPanTiltDevice::pantiltToHomePosition(), UCamPanTiltDevice::pantiltUpdatePosition(), UGpsLatLong::parseGPGGA(), UGpsStatus::parseGPGSA(), UGpsStatus::parseGPGSV(), UGpsLatLong::parseGPRMC(), UGpsUTM::parsePTNL(), UClientHandler::print(), UFuncStereo::processImages(), ULms100::receiveData(), ULms500::receiveData(), UHokuyo::receiveData(), USick::receiveData(), UObstacleGroup::removeAllObsts(), UReplayDevice::replayStep(), UFuncImu::run(), UFuncView::run(), UResSmrCtl::run(), UFuncPiCam::run(), UFuncKinect::run(), UCmdExe::run(), UResKeep::run(), UVariable::saveToLog(), UFuncEfLine::sendAllLines(), UFunctionVarPool::sendAllVar(), UFuncEfLine::sendBoxLines(), UFuncEfLine::sendBoxPose(), USmrCl::sendString(), UClientPort::sendWithLock(), UResLocater::set_poselast(), UResLocater::set_state(), UResLocater::set_utmstate(), UCamPwc::setBrightness(), UCamPwc::setColour(), UCamPwc::setContour(), UCamPwc::setContrast(), UCamPwc::setDataChannel(), UCamPwc::setDevice(), UCamPwc::setGain(), UCamPwc::setGamma(), UVarPool::setLogfile(), ULogFile::setLogName(), UResLink::setResource(), UResV360::setResource(), UCamPool::setResource(), UResPassable::setScan(), ULaserScan::setScan(), UCamPwc::setShutter(), UClientHandler::setVerbose(), UCamPwc::setVideoCap(), UResDisp::showUVImage(), UClientHandler::snprint(), UResSmrIf::testEvent(), ULogFile::toLog(), UImageLog::toLog(), UResV360::update(), UFuncKinect::updateCloud(), UResLocater::varprint(), UCamDevGuppy::~UCamDevGuppy(), UCamDevIeee1394::~UCamDevIeee1394(), and UImageLog::~UImageLog().

void ULock::lockInit ( )
inline

Initialize the lock to fast mutex.

References mLock.

Referenced by ULock(), and USickData::USickData().

void ULock::post ( )
inline
bool ULock::tryLock ( )
inline
bool ULock::tryWait ( )
inline

semaphore check for a post.

Returns
true if the post is accepted, and false if nothing is posted.

Referenced by UCamDevGigE::getImageSnapshot(), and UCamDevGigE::UCamDevGigE().

void ULock::unlock ( )
inline

semaphore unlock for this image.

References mLock.

Referenced by UResPcp::add(), UResPoly::add(), USFPool::addData(), UFeaturePool::addData(), UClientHandler::addFunction(), UMsgQueue::addMessage(), UObstacleGroupLaser::addObstPoly(), UObj3dGroup::addObstPoly(), UPoseHistNotUsed::addPoseHist(), UResPoseHist::addPoseHist(), UServerPushImplement::addPushWatch(), ULineMatch::addToPoly(), UFuncKinect::callGotNewDataWithObject(), UResV360::callGotNewDataWithObject(), ULaserDevice::callGotNewDataWithObject(), USick::changeMode(), UGpsLatLong::clear(), UCamPwc::closeDevice(), ULogFile::closeLog(), UResPoseHist::closeLogfile(), UImageLog::closeLogging(), ULms100::closePort(), ULms500::closePort(), UHokuyo::closePort(), UFuncLoca2::correlateLines(), UVarPool::createFunctionStack(), UVarPool::createVarPoolStack(), UVarPool::createVarStack(), ULms100::decodeData(), ULms500::decodeData(), UFuncKinect::decodeReplayLine(), UImagePool::decodeReplayLine(), UResPcp::del(), UResPoly::del(), UResKeep::deleteKeep(), UCamPwc::deviceExist(), UFuncGndAna::doAnalysis(), UFuncFz::doClassify(), UNamedBoxes::doDetect(), ULogFile::doFlush(), UClientHandler::doTimeTick(), UResDrivePos::driveOdo(), UResRoadDrive::driveSide(), UCmdExe::executePushFunction(), UImgPush::fillBuffer(), UImgPush::fillShowBuffer(), UCamPool::findDevices(), UResAuEf::findFeatures(), UResAvoid::findPathToHere(), UCamPwc::getBrightness(), UCamPwc::getColour(), UCamPwc::getCompPref(), UCamPwc::getContour(), UCamPwc::getContrast(), UCamPwc::getGain(), UCamPwc::getGamma(), UObstacleHist::getGroup(), UPoseHistNotUsed::getHistHeading(), UResPoseHist::getHistHeading(), UCamDevBase::getImageSnapshot(), UResV360::getMeasurementCnt(), UHokuyo::getNameFromDevice(), UAvoidPathPool::getNewAvoidPath(), ULaserSim::getNewestData(), UReplayDevice::getNewestData(), ULms100::getNewestData(), ULms500::getNewestData(), UHokuyo::getNewestData(), UResV360::getNewestData(), USick::getNewestData(), USick::getNewestLocked(), UAvoidPathPool::getNewPath(), USmlTag::getObstacleGroup(), UPoseHistNotUsed::getOldest(), UResPoseHist::getOldest(), UPoseHistNotUsed::getPoseFitAtDistance(), UResPoseHist::getPoseFitAtDistance(), UPoseHistNotUsed::getPoseNearDistance(), UResPoseHist::getPoseNearDistance(), UPoseHistNotUsed::getPoseNearTime(), UResPoseHist::getPoseNearTime(), UPoseHistNotUsed::getTimeAtDistance(), UResPoseHist::getTimeAtDistance(), UCamPwc::getWhiteBalance(), UFuncKinect::GetXYZCoordinates(), UClientHandler::gotNewData(), ULaserDevice::gotNewScan(), UResSmrIf::gotUserEvent(), UFunctionAvoid::handleAvoid(), UClientCamData::handleCamGet(), UFuncObj3d::handleCloud(), UFuncLobst::handleCommand(), UFuncPcp::handleCommand(), UFuncLinefinder::handleCommand(), UFunctionCamGmk::handleGmkGetCommand(), UFunctionImgPool::handleImageSetCommand(), UClientFuncSimScan::handleLaserScan(), UFuncLocalize::handleLocalize(), UResPcp::handleNewData(), UClientFuncObstGrp::handleObst(), UResLaserIfObst::handleObst(), UResLaserIfObst::handleObstGrp(), UCmdExe::handleOneMessageFromQueue(), UCmdExe::handleOneServerPushMessage(), UClientFuncPath::handlePathPolygonData(), UFuncStereo::handleStereo(), UResSmrCtl::implementDrivePath(), UResIf::interfaceTick(), UResLaserIfObst::listGroup(), UResLaserIfObst::listGroups(), UResLocater::locate(), UServerClient::logClose(), UResVarPool::logFileClose(), UResVarPool::logFileOpen(), UImageLog::logImage(), UFuncPiCam::logImageToFile(), UFuncPTgrey::logImageToFile(), UFuncKinect::logImageToFile(), UFuncTOF::logImageToFile(), UServerClient::logWrite(), UCamPool::makeDevice(), UFuncBall::makeDisplayPolygon(), UFuncImSeg::makeDisplayPolygon(), UFuncPCLTest::MakeMap(), UFuncKinect::makeObj3Dcloud(), UFuncKinect::makePCD(), UResLocater::match_points(), UResLaserIfObst::methodCall(), UResLobst::methodCallV(), UResAvoid::methodCallV(), UResCamIfGmk::newDataAvailable(), UCamPwc::openDevice(), UCamPwc::openDeviceDefault(), ULogFile::openLog(), UImageLog::openLog(), UResAuEf::openLog(), UResGps::openLogfile(), UHokuyo::openPort(), UNavPaint::paint(), UPaintPoseHist::paint(), UFuncFz::paintColoredImage(), UCamPanTiltDevice::pantiltSetPosition(), UCamPanTiltDevice::pantiltToHomePosition(), UCamPanTiltDevice::pantiltUpdatePosition(), UGpsLatLong::parseGPGGA(), UGpsStatus::parseGPGSA(), UGpsStatus::parseGPGSV(), UGpsLatLong::parseGPRMC(), UGpsUTM::parsePTNL(), UClientHandler::print(), UFuncTOF::processChannel8(), UFuncKinect::processDepthImages(), UFuncStereo::processImages(), UFuncTOF::processImages(), UCamPwc::readFramesThread(), UCamDevice::readFramesThread(), ULms100::receiveData(), ULms500::receiveData(), UHokuyo::receiveData(), USick::receiveData(), UFuncPTgrey::Receiver(), UObstacleGroup::removeAllObsts(), UReplayDevice::replayStep(), UFuncImu::run(), UFuncView::run(), UResSmrCtl::run(), UFuncPiCam::run(), UFuncKinect::run(), UCmdExe::run(), UResKeep::run(), UFuncV4lGst::run(), UFuncPiCam::runAlive(), UFuncPTgrey::runSetting(), UVariable::saveToLog(), UFuncEfLine::sendAllLines(), UFunctionVarPool::sendAllVar(), UFuncEfLine::sendBoxLines(), UFuncEfLine::sendBoxPose(), USmrCl::sendString(), UClientPort::sendWithLock(), UResLocater::set_poselast(), UResLocater::set_state(), UResLocater::set_utmstate(), UCamPwc::setBrightness(), UCamPwc::setColour(), UCamPwc::setCompPref(), UCamPwc::setContour(), UCamPwc::setContrast(), UCamPwc::setDataChannel(), UCamPwc::setDevice(), UCamPwc::setGain(), UCamPwc::setGamma(), UVarPool::setLogfile(), ULogFile::setLogName(), UResDrivePos::setManUnlocked(), UResRoadDrive::setManUnlocked(), UResLink::setResource(), UResV360::setResource(), UCamPool::setResource(), UResPassable::setScan(), ULaserScan::setScan(), UCamPwc::setShutter(), UClientHandler::setVerbose(), UCamPwc::setVideoCap(), UCamPwc::setWhiteBalance(), UHighGuiWindowHandle::showImage(), UResDisp::showUVImage(), UClientHandler::snprint(), UResSmrIf::testEvent(), testVideo3(), ULogFile::toLog(), UImageLog::toLog(), UClientPort::tryConnect(), UProbPolyQueue::unlockNextIn(), UProbPolyQueue::unlockNextOut(), UResLink::unlockPoseHist(), URoadLineData::update(), UResV360::update(), UFuncKinect::updateCloud(), UQtgui::updateImg(), UFuncV4lGst::useBuffer(), UResLocater::varprint(), UCamDevGuppy::~UCamDevGuppy(), UCamDevIeee1394::~UCamDevIeee1394(), UImageLog::~UImageLog(), and UResRoadDrive::~UResRoadDrive().

bool ULock::wait ( )
inline

semaphore to wait for a post signal.

References mLock.

Referenced by UFuncPTgrey::runSetting().

Member Data Documentation

pthread_mutex_t ULock::mLock
private

lock, when reading or writing

Referenced by lock(), lockInit(), post(), tryLock(), unlock(), wait(), and ~ULock().


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