]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
use usleep when possible, ./configure && make sure when you update
authorAnthony Minessale <anthony.minessale@gmail.com>
Sun, 17 Sep 2006 18:44:53 +0000 (18:44 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Sun, 17 Sep 2006 18:44:53 +0000 (18:44 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2722 d0543943-73ff-0310-b7d9-9358b9ac24b2

configure
configure.in
src/include/switch_am_config.h.in
src/include/switch_utils.h

index 7441f0f3084e4511ccc80291ba65c58cb75ec374..a9237a4f532f71af953fd1b1da76431bcba92949 100755 (executable)
--- a/configure
+++ b/configure
@@ -20843,7 +20843,8 @@ done
 
 
 
-for ac_func in gethostname vasprintf mmap mlock mlockall
+
+for ac_func in gethostname vasprintf mmap mlock mlockall usleep
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
index de16318384749d87a37cfc5f391a2d20097cb32c..cc79af29416269cb79d955acd877dc5f2ccd67e1 100644 (file)
@@ -34,7 +34,7 @@ AC_PROG_GCC_TRADITIONAL
 AC_FUNC_MALLOC
 AC_TYPE_SIGNAL
 AC_FUNC_STRFTIME
-AC_CHECK_FUNCS([gethostname vasprintf mmap mlock mlockall])
+AC_CHECK_FUNCS([gethostname vasprintf mmap mlock mlockall usleep])
 
 AC_C_BIGENDIAN(AC_DEFINE([__BYTE_ORDER],__BIG_ENDIAN,[Big Endian]),AC_DEFINE([__BYTE_ORDER],__LITTLE_ENDIAN,[Little Endian]))
 AC_DEFINE([__LITTLE_ENDIAN],1234,[for the places where it is not defined])
index ec727f3f723d7c8ef6103df5716c2b7bfab2e896..c2a949cebefad34dbeedbfa1536589dd6bd88616 100644 (file)
@@ -64,6 +64,9 @@
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
+/* Define to 1 if you have the `usleep' function. */
+#undef HAVE_USLEEP
+
 /* Define to 1 if you have the `vasprintf' function. */
 #undef HAVE_VASPRINTF
 
index ca916d275b8cfa267f3fb475174c0f1ba2c9ab81..dd6957df3457bf1932a6e84e2a687151be856198 100644 (file)
@@ -166,7 +166,11 @@ switch_mutex_unlock(obj->flag_mutex);
 /*!
   \brief Wait a desired number of microseconds and yield the CPU
 */
+#ifdef HAVE_USLEEP
+#define switch_yield(ms) usleep(ms);
+#else
 #define switch_yield(ms) apr_sleep(ms * 10); //apr_thread_yield();
+#endif
 
 /*!
   \brief Declares a function designed to set a dymaic global string