[Libsysio-commit] HEAD: libsysio Makefile.am Rules.make configure.in
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2008-06-17 17:19:04
|
Update of /cvsroot/libsysio/libsysio In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12543 Modified Files: Makefile.am Rules.make configure.in Log Message: Begin adding support for thread-safe operation. In detail: 1) Add smp.h and smp_posix.c 2) Add a big lock, wrapping the user API with appropriate mutex_lock and mutex_unlock calls. NB; initialization is *not* thread safe. 3) Add support for P_{GET,LOCK}, PB_LOCK, I_{GET,LOCK}, FIL_{GET,LOCK} and alter all related ref/de-ref usage to use get/put or lock/unlock as appropriate. 4) Remedial (no-op) support for MNT_GET. By default, POSIX threads supoprt is not enabled. To enable, use --with-threads, or --with-threads=yes, or --with-threads=posix. Index: Makefile.am =================================================================== RCS file: /cvsroot/libsysio/libsysio/Makefile.am,v retrieving revision 1.16 retrieving revision 1.17 diff -u -w -b -B -p -r1.16 -r1.17 --- Makefile.am 17 Jun 2008 15:17:30 -0000 1.16 +++ Makefile.am 17 Jun 2008 17:18:56 -0000 1.17 @@ -63,6 +63,7 @@ AM_CFLAGS = $(OPTIONAL_LUSTRE_CFLAGS) __LIBBUILD_DIR__libsysio_a_SOURCES = \ $(SRCDIR_SRCS) \ + $(THREAD_MODEL_POSIX_SRCS) \ $(OPTIONAL_STDDEV_SRCS) \ $(OPTIONAL_STDFD_SRCS) \ $(OPTIONAL_INCORE_SRCS) \ Index: Rules.make =================================================================== RCS file: /cvsroot/libsysio/libsysio/Rules.make,v retrieving revision 1.14 retrieving revision 1.15 diff -u -w -b -B -p -r1.14 -r1.15 --- Rules.make 17 Jun 2008 15:17:30 -0000 1.14 +++ Rules.make 17 Jun 2008 17:18:56 -0000 1.15 @@ -17,7 +17,14 @@ endif DEV_CPPFLAGS = $(STDFD_DEV_CPPFLAGS) $(STDDEV_DEV_CPPFLAGS) +if WITH_THREAD_MODEL_POSIX +THREAD_MODEL_POSIX_COMPILER_FLAGS=-pthread +else +THREAD_MODEL_POSIX_COMPILER_FLAGS= +endif + AM_CPPFLAGS = \ + $(THREAD_MODEL_POSIX_COMPILER_FLAGS) \ $(TRACING) \ $(AUTOMOUNT) $(ZERO_SUM_MEMORY) $(DEV_CPPFLAGS) $(SOCKETS_CPPFLAGS) \ $(DEFER_INIT_CWD) $(SYSIO_LABEL_NAMES) $(_HAVE_STATVFS) \ Index: configure.in =================================================================== RCS file: /cvsroot/libsysio/libsysio/configure.in,v retrieving revision 1.40 retrieving revision 1.41 diff -u -w -b -B -p -r1.40 -r1.41 --- configure.in 17 Jun 2008 15:17:30 -0000 1.40 +++ configure.in 17 Jun 2008 17:18:56 -0000 1.41 @@ -215,6 +215,23 @@ AC_ARG_WITH(alternate-symbols, esac]) AC_SUBST(SYSIO_LABEL_NAMES) +AC_ARG_WITH(threads, + AC_HELP_STRING([--with-threads@<:@=<model>@:>@], + [Enable thread-safe operation via named model]), + [ case "${withval}" in + yes|posix) AC_DEFINE(THREAD_MODEL_POSIX);; + no) ;; + *) AC_MSG_ERROR(bad value ${withval} for --with-threads) ;; + esac], + [with_threads=no]) +if test x$with_threads = xyes; then + with_threads=posix +fi +if test x$with_threads = xposix; then + AC_DEFINE(THREAD_MODEL_POSIX) +fi +AM_CONDITIONAL(WITH_THREAD_MODEL_POSIX, test x$with_threads = xposix) + # We keep the original values in `$config_*' and never modify them, so we # can write them unchanged into config.make. Everything else uses # $machine, $vendor, and $os, and changes them whenever convenient. |