Changeset 19897
- Timestamp:
- 04/05/07 16:54:02 (2 years ago)
- Files:
-
- juggler/trunk/modules/vapor/ChangeLog (modified) (1 diff)
- juggler/trunk/modules/vapor/Makefile.inc.in (modified) (1 diff)
- juggler/trunk/modules/vapor/Makefile.pre.in (modified) (2 diffs)
- juggler/trunk/modules/vapor/VERSION (modified) (1 diff)
- juggler/trunk/modules/vapor/boost_signals.fpc.in (copied) (copied from juggler/trunk/modules/vapor/boost_filesystem.fpc.in) (1 diff)
- juggler/trunk/modules/vapor/configure.ac (modified) (7 diffs)
- juggler/trunk/modules/vapor/vpr.fpc.in (modified) (1 diff)
- juggler/trunk/modules/vapor/vpr/Thread/BaseThread.cpp (modified) (1 diff)
- juggler/trunk/modules/vapor/vpr/Thread/BaseThread.h (modified) (2 diffs)
- juggler/trunk/modules/vapor/vpr/md/NSPR/Thread/ThreadNSPR.cpp (modified) (1 diff)
- juggler/trunk/modules/vapor/vpr/md/POSIX/Thread/ThreadPosix.cpp (modified) (1 diff)
- juggler/trunk/modules/vapor/vpr/md/WIN32/Thread/ThreadWin32.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
juggler/trunk/modules/vapor/ChangeLog
r19849 r19897 1 1 DATE AUTHOR CHANGE 2 2 ---------- -------- ----------------------------------------------------------- 3 2007-04-05 patrick Added thread start/exit notification signals. Boost.Signals 4 is now a required dependency. 5 NEW VERSION: 1.1.44 3 6 2007-03-03 patrick Allow callers of vpr::InetAddr::getAllLocalAddrs() to 4 7 indicate whether interfaces in the down state should be juggler/trunk/modules/vapor/Makefile.inc.in
r19729 r19897 374 374 $(topdir)/boost_filesystem.fpc \ 375 375 $(libdir)$(LIBBITSUF)/flagpoll/boost_filesystem-$(BOOST_VERSION).$(ISA).fpc 376 $(INSTALL) -m $(FILE_PERMS) $(GROUP_OPT_UNIX) \ 377 $(topdir)/boost_signals.fpc \ 378 $(libdir)$(LIBBITSUF)/flagpoll/boost_signals-$(BOOST_VERSION).$(ISA).fpc 376 379 ifeq ($(USE_NSPR), Y) 377 380 $(INSTALL) -m $(FILE_PERMS) $(GROUP_OPT_UNIX) \ juggler/trunk/modules/vapor/Makefile.pre.in
r19729 r19897 63 63 boost.fpc.in: ; 64 64 boost_filesystem.fpc.in: ; 65 boost_signals.fpc.in: ; 65 66 $(M4_DEPS): ; 66 67 $(srcdir)/VERSION: ; … … 73 74 Makefile: $(srcdir)/VERSION configure config.status Makefile.in \ 74 75 Makefile.inc.in make.defs.mk.in vpr.fpc.in boost.fpc.in \ 75 boost_filesystem.fpc.in 76 boost_filesystem.fpc.in boost_signals.fpc.in 76 77 $(CFG_SHELL) $(srcdir)/configure $(CONFIGURE_ARGS) 77 78 @$(MAKE) -f Makefile cleandepend juggler/trunk/modules/vapor/VERSION
r19849 r19897 1 1.1.44-0 @04/05/2007 21:55:00 UTC@ 1 2 1.1.43-0 @03/03/2007 17:10:00 UTC@ 2 3 1.1.42-0 @03/02/2007 17:55:00 UTC@ juggler/trunk/modules/vapor/boost_signals.fpc.in
r19450 r19897 3 3 4 4 # Standard Flagpoll Variables 5 Name: Boost. Filesystem6 Description: The Boost. Filesystem Library provides portable facilities to query and manipulate paths, files, and directories.7 URL: http://www.boost.org/ libs/filesystem/doc/index.htm5 Name: Boost.Signals 6 Description: The Boost.Signals library is an implementation of a managed signals and slots system. 7 URL: http://www.boost.org/doc/html/signals.html 8 8 Version: @BOOST_VERSION_DOT@ 9 Provides: Boost. Filesystem boost.filesystem9 Provides: Boost.Signals boost.signals 10 10 Requires: boost = @BOOST_VERSION_DOT@ 11 11 Arch: @ISA@ 12 12 Cflags: @BOOST_INCLUDES@ 13 Libs: -L@BOOST_LIBDIR@ -l@boost_ fs_name@13 Libs: -L@BOOST_LIBDIR@ -l@boost_signals_name@ juggler/trunk/modules/vapor/configure.ac
r19745 r19897 145 145 [given_boost_fs_libname="$withval"], [given_boost_fs_libname='']) 146 146 147 AC_ARG_WITH([boost-signals-lib], 148 [ --with-boost-signals-lib=<LIB NAME> 149 The name of the Boost.Signals 150 library suitable for the -l 151 compiler option [default=Auto-detect]], 152 [given_boost_signals_libname="$withval"], [given_boost_signals_libname='']) 153 147 154 # ----------------------------------------------------------------------------- 148 155 # System-dependent stuff. … … 618 625 fi 619 626 620 # Construct the Boost.Filesystem library name automatically based on Boost 621 # naming conventions if the user did not provide a library name. 622 if test "x$given_boost_fs_libname" = "x" ; then 623 case $CC in 624 gcc*|*/gcc*) 627 # Build up the possible Boost library suffix names. These will be stored in 628 # $boost_suffixes and used later as necessary. 629 case $CC in 630 gcc*|*/gcc*) 631 toolset='-gcc' 632 ;; 633 icc*|*/icc*) 634 if test "x$OS_TYPE" = "xWin32" ; then 635 toolset='-iw' 636 else 637 toolset='-il' 638 fi 639 ;; 640 cygcl|msvccc|cl*|CL*) 641 toolset="-${BOOST_TOOL:=vc7}" 642 ;; 643 cc*|*/cc*) 644 if test "x$GCC" = "xyes" ; then 625 645 toolset='-gcc' 626 ;; 627 icc*|*/icc*) 628 if test "x$OS_TYPE" = "xWin32" ; then 629 toolset='-iw' 630 else 631 toolset='-il' 632 fi 633 ;; 634 cygcl|msvccc|cl*|CL*) 635 toolset="-${BOOST_TOOL:=vc7}" 636 ;; 637 cc*|*/cc*) 638 if test "x$GCC" = "xyes" ; then 639 toolset='-gcc' 640 else 641 case $PLATFORM in 642 IRIX) 643 toolset='-mp' 644 ;; 645 Solaris) 646 toolset='-sw' 647 ;; 648 esac 649 fi 650 ;; 651 esac 652 653 # A correct installation of Boost on Darwin does not include the toolset name 654 # as part of the library file name. 655 if test "x$PLATFORM" = "xDarwin" ; then 656 toolset='' 657 threading='' 658 else 659 # We can only use multi-threading versions of Boost libraries if we are 660 # not using SPROC threads. Boost does not support SPROC. 661 if test "x$SUBSYSTEM" != "xSPROC" -a "x$ABI" != "x64" ; then 662 threading='-mt' 646 else 647 case $PLATFORM in 648 IRIX) 649 toolset='-mp' 650 ;; 651 Solaris) 652 toolset='-sw' 653 ;; 654 esac 663 655 fi 656 ;; 657 esac 658 659 # A correct installation of Boost on Darwin does not include the toolset name 660 # as part of the library file name. 661 if test "x$PLATFORM" = "xDarwin" ; then 662 toolset='' 663 threading='' 664 else 665 # We can only use multi-threading versions of Boost libraries if we are 666 # not using SPROC threads. Boost does not support SPROC. 667 if test "x$SUBSYSTEM" != "xSPROC" -a "x$ABI" != "x64" ; then 668 threading='-mt' 664 669 fi 665 666 boost_suffixes="$toolset$threading-$BOOST_LIB_VERSION $toolset$threading $threading" 667 else 670 fi 671 672 boost_suffixes="$toolset$threading-$BOOST_LIB_VERSION $toolset$threading $threading" 673 674 if test "x$given_boost_fs_libname" != "x" ; then 668 675 boost_fs_name="$given_boost_fs_libname" 676 fi 677 678 if test "x$given_boost_signals_libname" != "x" ; then 679 boost_signals_name="$given_boost_signals_libname" 669 680 fi 670 681 … … 733 744 done 734 745 735 DPP_LANG_RESTORE736 737 746 if test "x$vpr_have_boost_fs" != "xyes" ; then 738 747 AC_MSG_ERROR([*** Boost.Filesystem required by VPR ***]) 739 748 fi 749 750 testBoostSignals ( ) 751 { 752 libname="$1" 753 orig_LIBS="$2" 754 755 # NOTE: We do not need $ABI_FLAGS in $LDFLAGS since $CXXFLAGS and $LDFLAGS 756 # are used together by AC_TRY_LINK(). 757 LIBS="-l$libname $orig_LIBS" 758 759 AC_MSG_CHECKING([for boost::signal::operator()() in $libname]) 760 AC_TRY_LINK([#include <boost/signal.hpp>], 761 [boost::signal<void ()> s; s();], 762 [vpr_have_boost_signals='yes'], [vpr_have_boost_signals='no']) 763 rm -rf ./ii_files 764 AC_MSG_RESULT([$vpr_have_boost_signals]) 765 766 LIBS="$orig_LIBS" 767 } 768 769 LDFLAGS="-L$BOOST_LIBDIR $vprsave_LDFLAGS" 770 771 if test "x$boost_signals_name" != "x" ; then 772 testBoostSignals $boost_signals_name $vprsave_LIBS 773 else 774 # The extra empty string is to allow for no suffix to be used on the 775 # boost_signals library name. 776 for s in $boost_suffixes "" ; do 777 cur_boost_signals_name="boost_signals$s" 778 779 testBoostSignals $cur_boost_signals_name $vprsave_LIBS 780 781 if test "$vpr_have_boost_signals" = "yes" ; then 782 boost_signals_name="$cur_boost_signals_name" 783 break 784 fi 785 done 786 fi 787 788 if test "x$vpr_have_boost_signals" != "xyes" ; then 789 AC_MSG_ERROR([*** Boost.Signals required by VPR ***]) 790 fi 791 792 DPP_LANG_RESTORE 740 793 741 794 CXXFLAGS="$vprsave_CXXFLAGS" … … 909 962 # Put together the basic information needed to compile VPR applications. 910 963 if test "x$OS_TYPE" = "xWin32" ; then 911 APP_EXTRA_LIBS="$LDFLAGS $LIBS $CPPDOM_LDFLAGS $CPPDOM_LIBS $BOOST_LDFLAGS_LINK_EXE $boost_ fs_name.lib $NSPR_LDFLAGS_LINK_EXE $NSPR_LIB_LINK_EXE $PLC_LIB_LINK_EXE ws2_32.lib"964 APP_EXTRA_LIBS="$LDFLAGS $LIBS $CPPDOM_LDFLAGS $CPPDOM_LIBS $BOOST_LDFLAGS_LINK_EXE $boost_signals_name.lib $boost_fs_name.lib $NSPR_LDFLAGS_LINK_EXE $NSPR_LIB_LINK_EXE $PLC_LIB_LINK_EXE ws2_32.lib" 912 965 else 913 APP_EXTRA_LIBS="$LDFLAGS $CPPDOM_LDFLAGS $CPPDOM_LIBS $BOOST_LDFLAGS -l$boost_ fs_name $PTHREAD_ARG $LIBS $NSPR_LDFLAGS $NSPR_LIB $PLC_LIB $PTHREAD_LIB $SEM_LIB $SOCKET_LIB $NS_LIB $UUID_LIB $DYN_LOAD_LIB"966 APP_EXTRA_LIBS="$LDFLAGS $CPPDOM_LDFLAGS $CPPDOM_LIBS $BOOST_LDFLAGS -l$boost_signals_name -l$boost_fs_name $PTHREAD_ARG $LIBS $NSPR_LDFLAGS $NSPR_LIB $PLC_LIB $PTHREAD_LIB $SEM_LIB $SOCKET_LIB $NS_LIB $UUID_LIB $DYN_LOAD_LIB" 914 967 fi 915 968 … … 953 1006 # Dependencies for dynamic/shared libraries. 954 1007 if test "x$OS_TYPE" = "xWin32" ; then 955 DYLIB_DEPS="$CPPDOM_LDFLAGS $CPPDOM_LIBS $BOOST_LDFLAGS_LINK_EXE $boost_ fs_name.lib $NSPR_LDFLAGS_LINK_EXE $NSPR_LIB_LINK_EXE $PLC_LIB_LINK_EXE ws2_32.lib"1008 DYLIB_DEPS="$CPPDOM_LDFLAGS $CPPDOM_LIBS $BOOST_LDFLAGS_LINK_EXE $boost_signals_name.lib $boost_fs_name.lib $NSPR_LDFLAGS_LINK_EXE $NSPR_LIB_LINK_EXE $PLC_LIB_LINK_EXE ws2_32.lib" 956 1009 else 957 1010 DYLIB_DEPS="$APP_EXTRA_LIBS" … … 1078 1131 AC_SUBST(BOOST_LIBDIR) 1079 1132 AC_SUBST(boost_fs_name) 1133 AC_SUBST(boost_signals_name) 1080 1134 AC_SUBST(subsystem_cxxflags) 1081 1135 AC_SUBST(subsystem_libs) … … 1100 1154 boost.fpc 1101 1155 boost_filesystem.fpc 1156 boost_signals.fpc 1102 1157 nspr.fpc 1103 1158 vpr.fpc juggler/trunk/modules/vapor/vpr.fpc.in
r19464 r19897 65 65 Version: ${vpr_version} 66 66 Provides: vpr VPR 67 Requires: Boost. Filesystem = @BOOST_VERSION_DOT@ boost >= @BOOST_VERSION_DOT@ cppdom = @CPPDOM_VERSION@ ${extra_deps}67 Requires: Boost.Signals = @BOOST_VERSION_DOT@ Boost.Filesystem = @BOOST_VERSION_DOT@ boost >= @BOOST_VERSION_DOT@ cppdom = @CPPDOM_VERSION@ ${extra_deps} 68 68 Arch: ${ISA} 69 69 Cflags: ${vpr_cxxflags} ${vpr_extra_cxxflags} ${subsystem_cxxflags} -I${includedir} ${ABI_FLAGS} juggler/trunk/modules/vapor/vpr/Thread/BaseThread.cpp
r19729 r19897 36 36 #include <vpr/vprConfig.h> 37 37 38 #include <vpr/Thread/BaseThread.h> 38 #include <iomanip> 39 40 #include <vpr/Sync/Guard.h> 39 41 #include <vpr/Thread/Thread.h> 40 42 #include <vpr/Thread/ThreadManager.h> 41 #include <iomanip> 43 #include <vpr/Thread/BaseThread.h> 44 42 45 43 46 namespace vpr 44 47 { 45 48 49 BaseThread::state_signal_t BaseThread::sStartSignal; 50 BaseThread::state_signal_t BaseThread::sExitSignal; 51 vpr::Mutex sStartSignalLock; 52 vpr::Mutex sExitSignalLock; 53 46 54 vpr::Int32 BaseThread::mNextThreadId = 0; 47 55 vpr::TSTable BaseThread::gTSTable; 56 57 boost::signals::connection BaseThread:: 58 addThreadStartCallback(BaseThread::state_signal_t::slot_function_type slot) 59 { 60 vpr::Guard<vpr::Mutex> g(sStartSignalLock); 61 return sStartSignal.connect(slot); 62 } 63 64 boost::signals::connection BaseThread:: 65 addThreadExitCallback(BaseThread::state_signal_t::slot_function_type slot) 66 { 67 vpr::Guard<vpr::Mutex> g(sExitSignalLock); 68 return sExitSignal.connect(slot); 69 } 48 70 49 71 /** juggler/trunk/modules/vapor/vpr/Thread/BaseThread.h
r19825 r19897 40 40 41 41 #include <boost/function.hpp> 42 #include <boost/signal.hpp> 42 43 #include <vpr/vprTypes.h> 43 44 #include <vpr/Thread/TSTable.h> /* Needed to cache a copy here */ 45 44 46 45 47 namespace vpr … … 64 66 class VPR_CLASS_API BaseThread 65 67 { 68 public: 69 /** @name Thread State Callback Handling */ 70 //@{ 71 /** 72 * The type for the thread start and exit signals. 73 * 74 * @since 1.1.44 75 */ 76 typedef boost::signal<void (vpr::Thread*)> state_signal_t; 77 78 /** 79 * Connects the given slot to the signal emitted whenever a new thread 80 * begins its execution. The slot is invoked immediately before the thread 81 * functor is invoked. 82 * 83 * @post \p slot is connected to \c sStartSignal. 84 * 85 * @param slot The slot object to be connected to the thread start signal. 86 * 87 * @return The connection object that holds the association between the 88 * start signal and the given slot. 89 * 90 * @since 1.1.44 91 */ 92 static boost::signals::connection 93 addThreadStartCallback(state_signal_t::slot_function_type slot); 94 95 /** 96 * Connects the given slot to the signal emitted whenever a running thread 97 * completes its execution. The slot is invoked immediately after the 98 * thread functor returns. 99 * 100 * @post \p slot is connected to \c sExitSignal. 101 * 102 * @param slot The slot object to be connected to the thread exit signal. 103 * 104 * @return The connection object that holds the association between the 105 * exit signal and the given slot. 106 * 107 * @since 1.1.44 108 */ 109 static boost::signals::connection 110 addThreadExitCallback(state_signal_t::slot_function_type slot); 111 //@} 112 113 protected: 114 /** 115 * Emits the thread start signal. 116 * 117 * @since 1.1.44 118 */ 119 static void emitThreadStart(vpr::Thread* thread) 120 { 121 sStartSignal(thread); 122 } 123 124 /** 125 * Emits the thread exit signal. 126 * 127 * @since 1.1.44 128 */ 129 static void emitThreadExit(vpr::Thread* thread) 130 { 131 sExitSignal(thread); 132 } 133 134 private: 135 static state_signal_t sStartSignal; 136 static state_signal_t sExitSignal; 137 66 138 public: 67 139 enum VPRThreadPriority juggler/trunk/modules/vapor/vpr/md/NSPR/Thread/ThreadNSPR.cpp
r19729 r19897 247 247 try 248 248 { 249 emitThreadStart(this); 250 249 251 // --- CALL USER FUNCTOR --- // 250 252 mUserThreadFunctor(); 253 254 emitThreadExit(this); 251 255 } 252 256 catch (std::exception& ex) juggler/trunk/modules/vapor/vpr/md/POSIX/Thread/ThreadPosix.cpp
r19729 r19897 276 276 try 277 277 { 278 emitThreadStart(this); 279 278 280 // --- CALL USER FUNCTOR --- // 279 281 mUserThreadFunctor(); 282 283 emitThreadExit(this); 280 284 } 281 285 catch (std::exception& ex) juggler/trunk/modules/vapor/vpr/md/WIN32/Thread/ThreadWin32.cpp
r19729 r19897 219 219 try 220 220 { 221 emitThreadStart(this); 222 221 223 // --- CALL USER FUNCTOR --- // 222 224 mUserThreadFunctor(); 225 226 emitThreadExit(this); 223 227 } 224 228 catch (std::exception& ex)
