Hi, I noticed in corelib/thread.cpp and inc/ucommon/thread.h that Mutex::gaurd is probably meant to be spelled Mutex::guard. I've attached a trivial patch which fixes this typo.
Best, Tristan -- Tristan Matthews Développeur de logiciels libres tristan.matth...@savoirfairelinux.com Ligne directe: 514-276-5468 poste 113 Fax : 514-276-5465 7275 Saint Urbain Bureau 200 Montréal, QC, H2R 2Y5
From 9dc3bb8ced018c26b38631bc7b9e2b3a88998cfc Mon Sep 17 00:00:00 2001 From: Tristan Matthews <tristan.matth...@savoirfairelinux.com> Date: Wed, 4 Apr 2012 13:37:30 -0400 Subject: [PATCH 1/1] thread: fixed spelling of "gaurd" to "guard" --- corelib/thread.cpp | 30 +++++++------- inc/ucommon/thread.h | 106 +++++++++++++++++++++++++------------------------- 2 files changed, 68 insertions(+), 68 deletions(-) diff --git a/corelib/thread.cpp b/corelib/thread.cpp index 3a75cd9..887b88f 100644 --- a/corelib/thread.cpp +++ b/corelib/thread.cpp @@ -1015,24 +1015,24 @@ void auto_protect::operator=(void *obj) Mutex::protect(object); } -Mutex::gaurd::gaurd() +Mutex::guard::guard() { object = NULL; } -Mutex::gaurd::gaurd(void *obj) +Mutex::guard::guard(void *obj) { object = obj; if(obj) Mutex::protect(object); } -Mutex::gaurd::~gaurd() +Mutex::guard::~guard() { release(); } -void Mutex::gaurd::set(void *obj) +void Mutex::guard::set(void *obj) { release(); object = obj; @@ -1040,7 +1040,7 @@ void Mutex::gaurd::set(void *obj) Mutex::protect(object); } -void Mutex::gaurd::release(void) +void Mutex::guard::release(void) { if(object) { Mutex::release(object); @@ -1078,12 +1078,12 @@ void ThreadLock::indexing(unsigned index) } } -ThreadLock::gaurd_reader::gaurd_reader() +ThreadLock::guard_reader::guard_reader() { object = NULL; } -ThreadLock::gaurd_reader::gaurd_reader(void *obj) +ThreadLock::guard_reader::guard_reader(void *obj) { object = obj; if(obj) @@ -1091,12 +1091,12 @@ ThreadLock::gaurd_reader::gaurd_reader(void *obj) object = NULL; } -ThreadLock::gaurd_reader::~gaurd_reader() +ThreadLock::guard_reader::~guard_reader() { release(); } -void ThreadLock::gaurd_reader::set(void *obj) +void ThreadLock::guard_reader::set(void *obj) { release(); object = obj; @@ -1105,7 +1105,7 @@ void ThreadLock::gaurd_reader::set(void *obj) object = NULL; } -void ThreadLock::gaurd_reader::release(void) +void ThreadLock::guard_reader::release(void) { if(object) { ThreadLock::release(object); @@ -1113,12 +1113,12 @@ void ThreadLock::gaurd_reader::release(void) } } -ThreadLock::gaurd_writer::gaurd_writer() +ThreadLock::guard_writer::guard_writer() { object = NULL; } -ThreadLock::gaurd_writer::gaurd_writer(void *obj) +ThreadLock::guard_writer::guard_writer(void *obj) { object = obj; if(obj) @@ -1126,12 +1126,12 @@ ThreadLock::gaurd_writer::gaurd_writer(void *obj) object = NULL; } -ThreadLock::gaurd_writer::~gaurd_writer() +ThreadLock::guard_writer::~guard_writer() { release(); } -void ThreadLock::gaurd_writer::set(void *obj) +void ThreadLock::guard_writer::set(void *obj) { release(); object = obj; @@ -1140,7 +1140,7 @@ void ThreadLock::gaurd_writer::set(void *obj) object = NULL; } -void ThreadLock::gaurd_writer::release(void) +void ThreadLock::guard_writer::release(void) { if(object) { ThreadLock::release(object); diff --git a/inc/ucommon/thread.h b/inc/ucommon/thread.h index aa2da5b..6a562d2 100644 --- a/inc/ucommon/thread.h +++ b/inc/ucommon/thread.h @@ -556,102 +556,102 @@ protected: public: /** - * Gaurd class to apply scope based access locking to objects. The rwlock + * guard class to apply scope based access locking to objects. The rwlock * is located from the rwlock pool rather than contained in the target - * object, and the read lock is released when the gaurd object falls out of + * object, and the read lock is released when the guard object falls out of * scope. This is essentially an automation mechanism for mutex::reader. * @author David Sugar <dy...@gnutelephony.org> */ - class __EXPORT gaurd_reader + class __EXPORT guard_reader { private: void *object; public: /** - * Create an unitialized instance of gaurd. Usually used with a - * gaurd = operator. + * Create an unitialized instance of guard. Usually used with a + * guard = operator. */ - gaurd_reader(); + guard_reader(); /** - * Construct a gaurd for a specific object. - * @param object to gaurd. + * Construct a guard for a specific object. + * @param object to guard. */ - gaurd_reader(void *object); + guard_reader(void *object); /** - * Release mutex when gaurd falls out of scope. + * Release mutex when guard falls out of scope. */ - ~gaurd_reader(); + ~guard_reader(); /** - * Set gaurd to mutex lock a new object. If a lock is currently + * Set guard to mutex lock a new object. If a lock is currently * held, it is released. - * @param object to gaurd. + * @param object to guard. */ void set(void *object); /** - * Prematurely release a gaurd. + * Prematurely release a guard. */ void release(void); /** - * Set gaurd to read lock a new object. If a lock is currently + * Set guard to read lock a new object. If a lock is currently * held, it is released. - * @param pointer to object to gaurd. + * @param pointer to object to guard. */ inline void operator=(void *pointer) {set(pointer);}; }; /** - * Gaurd class to apply scope based exclusive locking to objects. The rwlock + * guard class to apply scope based exclusive locking to objects. The rwlock * is located from the rwlock pool rather than contained in the target - * object, and the write lock is released when the gaurd object falls out of + * object, and the write lock is released when the guard object falls out of * scope. This is essentially an automation mechanism for mutex::writer. * @author David Sugar <dy...@gnutelephony.org> */ - class __EXPORT gaurd_writer + class __EXPORT guard_writer { private: void *object; public: /** - * Create an unitialized instance of gaurd. Usually used with a - * gaurd = operator. + * Create an unitialized instance of guard. Usually used with a + * guard = operator. */ - gaurd_writer(); + guard_writer(); /** - * Construct a gaurd for a specific object. - * @param object to gaurd. + * Construct a guard for a specific object. + * @param object to guard. */ - gaurd_writer(void *object); + guard_writer(void *object); /** - * Release mutex when gaurd falls out of scope. + * Release mutex when guard falls out of scope. */ - ~gaurd_writer(); + ~guard_writer(); /** - * Set gaurd to mutex lock a new object. If a lock is currently + * Set guard to mutex lock a new object. If a lock is currently * held, it is released. - * @param object to gaurd. + * @param object to guard. */ void set(void *object); /** - * Prematurely release a gaurd. + * Prematurely release a guard. */ void release(void); /** - * Set gaurd to read lock a new object. If a lock is currently + * Set guard to read lock a new object. If a lock is currently * held, it is released. - * @param pointer to object to gaurd. + * @param pointer to object to guard. */ inline void operator=(void *pointer) {set(pointer);}; @@ -677,10 +677,10 @@ public: bool access(timeout_t timeout = Timer::inf); /** - * Specify hash table size for gaurd protection. The default is 1. + * Specify hash table size for guard protection. The default is 1. * This should be called at initialization time from the main thread * of the application before any other threads are created. - * @param size of hash table used for gaurding. + * @param size of hash table used for guarding. */ static void indexing(unsigned size); @@ -1131,51 +1131,51 @@ protected: public: /** - * Gaurd class to apply scope based mutex locking to objects. The mutex + * guard class to apply scope based mutex locking to objects. The mutex * is located from the mutex pool rather than contained in the target - * object, and the lock is released when the gaurd object falls out of + * object, and the lock is released when the guard object falls out of * scope. This is essentially an automation mechanism for mutex::protect. * @author David Sugar <dy...@gnutelephony.org> */ - class __EXPORT gaurd + class __EXPORT guard { private: void *object; public: /** - * Create an unitialized instance of gaurd. Usually used with a - * gaurd = operator. + * Create an unitialized instance of guard. Usually used with a + * guard = operator. */ - gaurd(); + guard(); /** - * Construct a gaurd for a specific object. - * @param object to gaurd. + * Construct a guard for a specific object. + * @param object to guard. */ - gaurd(void *object); + guard(void *object); /** - * Release mutex when gaurd falls out of scope. + * Release mutex when guard falls out of scope. */ - ~gaurd(); + ~guard(); /** - * Set gaurd to mutex lock a new object. If a lock is currently + * Set guard to mutex lock a new object. If a lock is currently * held, it is released. - * @param object to gaurd. + * @param object to guard. */ void set(void *object); /** - * Prematurely release a gaurd. + * Prematurely release a guard. */ void release(void); /** - * Set gaurd to mutex lock a new object. If a lock is currently + * Set guard to mutex lock a new object. If a lock is currently * held, it is released. - * @param pointer to object to gaurd. + * @param pointer to object to guard. */ inline void operator=(void *pointer) {set(pointer);}; @@ -1273,15 +1273,15 @@ public: {pthread_mutex_unlock(lock);}; /** - * Specify hash table size for gaurd protection. The default is 1. + * Specify hash table size for guard protection. The default is 1. * This should be called at initialization time from the main thread * of the application before any other threads are created. - * @param size of hash table used for gaurding. + * @param size of hash table used for guarding. */ static void indexing(unsigned size); /** - * Specify pointer/object/resource to gaurd protect. This uses a + * Specify pointer/object/resource to guard protect. This uses a * dynamically managed mutex. * @param pointer to protect. */ -- 1.7.5.4
_______________________________________________ Bug-commoncpp mailing list Bug-commoncpp@gnu.org https://lists.gnu.org/mailman/listinfo/bug-commoncpp