[complement-svn] SF.net SVN: complement: [1591] branches/complement-xmt/explore
Status: Pre-Alpha
Brought to you by:
complement
From: <com...@us...> - 2007-06-29 12:40:15
|
Revision: 1591 http://svn.sourceforge.net/complement/?rev=1591&view=rev Author: complement Date: 2007-06-29 05:40:12 -0700 (Fri, 29 Jun 2007) Log Message: ----------- Spinlock was renamed to spinlock, LockerExt to native_scoped_lock Modified Paths: -------------- branches/complement-xmt/explore/include/mt/xmt.h branches/complement-xmt/explore/include/stem/EvManager.h branches/complement-xmt/explore/lib/mt/ChangeLog branches/complement-xmt/explore/lib/stem/EvManager.cc branches/complement-xmt/explore/test/mt/mt_test.cc Modified: branches/complement-xmt/explore/include/mt/xmt.h =================================================================== --- branches/complement-xmt/explore/include/mt/xmt.h 2007-06-29 12:03:13 UTC (rev 1590) +++ branches/complement-xmt/explore/include/mt/xmt.h 2007-06-29 12:40:12 UTC (rev 1591) @@ -372,17 +372,17 @@ #ifdef __FIT_PTHREAD_SPINLOCK // Spinlock-based locks (IEEE Std. 1003.1j-2000) -template <bool RS, bool SCOPE> class __Spinlock; +template <bool RS, bool SCOPE> class __spinlock; template <bool SCOPE> -class __Spinlock<false,SCOPE> : +class __spinlock<false,SCOPE> : public __spinlock_base<SCOPE> { public: - __Spinlock() + __spinlock() { } - ~__Spinlock() + ~__spinlock() { } void lock() @@ -408,17 +408,22 @@ pthread_spin_unlock( &this->_M_lock ); # endif } + + private: + __spinlock( const __spinlock& ) + { } + }; template <bool SCOPE> -class __Spinlock<true,SCOPE> : // Recursive safe +class __spinlock<true,SCOPE> : // Recursive safe public __spinlock_base<SCOPE> { public: - __Spinlock() + __spinlock() { } - ~__Spinlock() + ~__spinlock() { } void lock() @@ -493,6 +498,10 @@ # ifdef __FIT_UITHREADS thread_t _id; # endif + + private: + __spinlock( const __spinlock& ) + { } }; #endif // __FIT_PTHREAD_SPINLOCK @@ -890,8 +899,8 @@ typedef __rw_mutex<false> rw_mutex; #endif // __FIT_RWLOCK #ifdef __FIT_PTHREAD_SPINLOCK -typedef __Spinlock<false,false> Spinlock; -typedef __Spinlock<true,false> SpinlockRS; +typedef __spinlock<false,false> spinlock; +typedef __spinlock<true,false> recursive_spinlock; #endif // __FIT_RWLOCK typedef basic_lock<mutex> scoped_lock; @@ -901,21 +910,21 @@ typedef basic_lock<__rw_mutex<false> > wr_scoped_lock; #endif // __FIT_RWLOCK #ifdef __FIT_PTHREAD_SPINLOCK -typedef basic_lock<Spinlock> LockerSpin; -typedef basic_lock<SpinlockRS> LockerSpinRS; +typedef basic_lock<spinlock> spin_scoped_lock; +typedef basic_lock<recursive_spinlock> recursive_spin_scoped_lock; #endif // __FIT_RWLOCK -class LockerExt +class native_scoped_lock { public: #ifdef _PTHREADS - explicit LockerExt( const pthread_mutex_t& m ) : + explicit native_scoped_lock( const pthread_mutex_t& m ) : #endif #ifdef __FIT_UITHREADS - explicit LockerExt( const mutex_t& m ) : + explicit native_scoped_lock( const mutex_t& m ) : #endif #ifdef __FIT_WIN32THREADS - explicit LockerExt( const CRITICAL_SECTION& m ) : + explicit native_scoped_lock( const CRITICAL_SECTION& m ) : #endif _M_lock( m ) { @@ -930,7 +939,7 @@ #endif } - ~LockerExt() + ~native_scoped_lock() { #ifdef _PTHREADS pthread_mutex_unlock( const_cast<pthread_mutex_t *>(&_M_lock) ); @@ -944,7 +953,7 @@ } private: - LockerExt( const LockerExt& m ) : + native_scoped_lock( const native_scoped_lock& m ) : _M_lock( m._M_lock ) { } #ifdef _PTHREADS Modified: branches/complement-xmt/explore/include/stem/EvManager.h =================================================================== --- branches/complement-xmt/explore/include/stem/EvManager.h 2007-06-29 12:03:13 UTC (rev 1590) +++ branches/complement-xmt/explore/include/stem/EvManager.h 2007-06-29 12:40:12 UTC (rev 1591) @@ -246,7 +246,7 @@ bool _dispatch_stop; xmt::Thread _ev_queue_thr; - xmt::Spinlock _ev_queue_dispatch_guard; + xmt::spinlock _ev_queue_dispatch_guard; xmt::mutex _lock_heap; xmt::mutex _lock_iheap; Modified: branches/complement-xmt/explore/lib/mt/ChangeLog =================================================================== --- branches/complement-xmt/explore/lib/mt/ChangeLog 2007-06-29 12:03:13 UTC (rev 1590) +++ branches/complement-xmt/explore/lib/mt/ChangeLog 2007-06-29 12:40:12 UTC (rev 1591) @@ -8,8 +8,10 @@ recursive_scoped_lock; obsolete LockerSDS removed; * xmt.h: LockerRd renamed to rd_scoped_lock, LockerWr to wr_scoped_lock, - __mutex_rw_base to __rw_mutex_base, mutexRW to rw_mutex. + __mutex_rw_base to __rw_mutex_base, mutexRW to rw_mutex; + * xmt.h: Spinlock was renamed to spinlock, LockerExt to native_scoped_lock. + 2007-06-14 Petr Ovtchenkov <pt...@is...> * xmt.h, xmt.cc, shm.h: step to interface like boost or Modified: branches/complement-xmt/explore/lib/stem/EvManager.cc =================================================================== --- branches/complement-xmt/explore/lib/stem/EvManager.cc 2007-06-29 12:03:13 UTC (rev 1590) +++ branches/complement-xmt/explore/lib/stem/EvManager.cc 2007-06-29 12:40:12 UTC (rev 1591) @@ -72,7 +72,7 @@ bool EvManager::not_finished() { - xmt::LockerSpin _lk( _ev_queue_dispatch_guard ); + xmt::spin_scoped_lock _lk( _ev_queue_dispatch_guard ); return !_dispatch_stop; } Modified: branches/complement-xmt/explore/test/mt/mt_test.cc =================================================================== --- branches/complement-xmt/explore/test/mt/mt_test.cc 2007-06-29 12:03:13 UTC (rev 1590) +++ branches/complement-xmt/explore/test/mt/mt_test.cc 2007-06-29 12:40:12 UTC (rev 1591) @@ -198,7 +198,7 @@ */ #ifdef __FIT_PTHREAD_SPINLOCK -static xmt::Spinlock sl1; +static xmt::spinlock sl1; xmt::Thread::ret_code thr1s( void *p ) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |