diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2015-07-23 16:53:42 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2015-07-23 16:53:42 (GMT) |
commit | 7d2d8c6e1118e4a9efca45f358528535202145fc (patch) | |
tree | 73d5cc27a2fdf277ab22129857f9bd85e2f6a300 /unix/tcl.m4 | |
parent | dd3c1d71f78e7e5ae79ee8918749368883b47531 (diff) | |
parent | a7f9c9200142b2372f40acedf0696bb6f2549d4e (diff) | |
download | tcl-7d2d8c6e1118e4a9efca45f358528535202145fc.zip tcl-7d2d8c6e1118e4a9efca45f358528535202145fc.tar.gz tcl-7d2d8c6e1118e4a9efca45f358528535202145fc.tar.bz2 |
Fix bug [57945b574a6df0332efc4ac96b066f7c347b28f7|57945b574a]: lock in forking process under heavy multithreading. Thanks to Joe Mistachkin for the implementation of the fix, and Gustaf Neumann for the original report and testing the fix.
Diffstat (limited to 'unix/tcl.m4')
-rw-r--r-- | unix/tcl.m4 | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/unix/tcl.m4 b/unix/tcl.m4 index c4e4675..3db997a 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -808,6 +808,48 @@ AC_DEFUN([SC_ENABLE_SYMBOLS], [ ]) #------------------------------------------------------------------------ +# SC_ENABLE_USLEEP -- +# +# Allows use of usleep function. +# This is only relevant for Unix. +# +# Arguments: +# none +# +# Results: +# +# Adds the following arguments to configure: +# --enable-usleep=yes|no (default is yes) +# +# Defines the following vars: +# HAVE_USLEEP Triggers use of usleep if defined. +#------------------------------------------------------------------------ + +AC_DEFUN([SC_ENABLE_USLEEP], [ + AC_ARG_ENABLE(usleep, + AC_HELP_STRING([--enable-usleep], + [use usleep if possible to sleep, otherwise use Tcl_Sleep (default: on)]), + [usleep_ok=$enableval], [usleep_ok=yes]) + + HAVE_USLEEP=0 + if test "$usleep_ok" = "yes"; then + AC_CHECK_HEADER(unistd.h,[usleep_ok=yes],[usleep_ok=no]) + fi + AC_MSG_CHECKING([whether to use usleep]) + if test "$usleep_ok" = "yes"; then + AC_CACHE_VAL(tcl_cv_usleep_h, [ + AC_TRY_COMPILE([#include <unistd.h>], [usleep(0);], + [tcl_cv_usleep_h=yes],[tcl_cv_usleep_h=no])]) + AC_MSG_RESULT([$tcl_cv_usleep_h]) + if test $tcl_cv_usleep_h = yes; then + AC_DEFINE(HAVE_USLEEP, 1, [Do we have usleep()?]) + fi + else + AC_MSG_RESULT([$usleep_ok]) + fi +]) + +#------------------------------------------------------------------------ # SC_ENABLE_LANGINFO -- # # Allows use of modern nl_langinfo check for better l10n. |