Go Back   ZeroC Forums > Comments

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 12-17-2006
n2503v n2503v is offline
Registered User
 
Name: Alex Makarenko
Organization: ACFR, University of Sydney
Project: Orca
 
Join Date: Jun 2005
Posts: 82
Post Doc: return value of RecMutex::tryLock()

What does RecMutex::tryLock() return when the mutex is already locked by the same thread? I assume it's FALSE but the manual seems to say something different.

Manual sec. 29.5
"The tryLock function works like lock, but, instead of blocking the caller, it returns false if the mutex is locked by another thread. Otherwise, the return value is true."

RecMutex.h
"Returns true if the lock was acquired, and false otherwise."
__________________
Alex Makarenko
Australian Centre for Field Robotics
The University of Sydney
www.cas.edu.au
project: orca-robotics.sf.net
Reply With Quote
  #2 (permalink)  
Old 12-18-2006
benoit's Avatar
benoit benoit is online now
ZeroC Staff
 
Name: Benoit Foucher
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Rennes, France
Posts: 1,534
Hi,

The manual is correct, if the mutex is already locked by the calling thread tryLock() returns true. The comment in the header file is a bit misleading, it will be fixed!

Cheers,
Benoit.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
About return struct billwillman Help Center 7 10-16-2006 03:39 AM
why return false ? OrNot Help Center 2 01-04-2006 02:50 AM
return value of getPropertyAsInt n2503v Help Center 3 10-19-2005 05:58 PM
can stringToProxy return nil pointer? andhow Help Center 1 02-03-2005 08:43 AM
portability problems with RecMutex ctor marlowa Patches 6 02-23-2003 04:45 PM


All times are GMT -4. The time now is 08:00 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.