]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add set/clear flag locked macros
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 22 Jun 2006 23:38:44 +0000 (23:38 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 22 Jun 2006 23:38:44 +0000 (23:38 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1661 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_utils.h

index 6ebae53bcba2f068d7c0cd27767b7dc816dc9fd2..ba18681bf220829378ef1d59785aefc6ab3cf06e 100644 (file)
@@ -112,11 +112,25 @@ SWITCH_DECLARE(unsigned char) switch_char_to_rfc2833(char key);
 */
 #define switch_set_flag(obj, flag) (obj)->flags |= (flag)
 
+/*!
+  \brief Set a flag on an arbitrary object while locked
+  \param obj the object to set the flags on
+  \param flag the or'd list of flags to set
+*/
+#define switch_set_flag_locked(obj, flag) switch_mutex_lock(obj->flag_mutex); (obj)->flags |= (flag); switch_mutex_unlock(obj->flag_mutex);
+
 /*!
   \brief Clear a flag on an arbitrary object
   \param obj the object to test
   \param flag the or'd list of flags to clear
 */
+#define switch_clear_flag_locked(obj, flag) switch_mutex_lock(obj->flag_mutex); (obj)->flags &= ~(flag); switch_mutex_unlock(obj->flag_mutex);
+
+/*!
+  \brief Clear a flag on an arbitrary object while locked
+  \param obj the object to test
+  \param flag the or'd list of flags to clear
+*/
 #define switch_clear_flag(obj, flag) (obj)->flags &= ~(flag)
 
 /*!