[complement-svn] SF.net SVN: complement: [1603] branches/complement-xmt/explore
Status: Pre-Alpha
Brought to you by:
complement
From: <com...@us...> - 2007-07-11 17:56:04
|
Revision: 1603 http://svn.sourceforge.net/complement/?rev=1603&view=rev Author: complement Date: 2007-07-11 10:56:00 -0700 (Wed, 11 Jul 2007) Log Message: ----------- Condition replaced by condition Modified Paths: -------------- branches/complement-xmt/explore/include/mt/shm.h branches/complement-xmt/explore/include/mt/xmt.h branches/complement-xmt/explore/include/sockios/sockmgr.cc branches/complement-xmt/explore/include/sockios/sockmgr.h branches/complement-xmt/explore/include/stem/Cron.h branches/complement-xmt/explore/include/stem/EvManager.h branches/complement-xmt/explore/lib/mt/ChangeLog branches/complement-xmt/explore/lib/sockios/ChangeLog branches/complement-xmt/explore/lib/stem/ChangeLog branches/complement-xmt/explore/test/mt/lfs.cc branches/complement-xmt/explore/test/mt/mt_test.cc branches/complement-xmt/explore/test/mt/signal-1.cc branches/complement-xmt/explore/test/mt/signal-3.cc branches/complement-xmt/explore/test/sockios/bytes_in_socket.cc branches/complement-xmt/explore/test/sockios/bytes_in_socket2.cc branches/complement-xmt/explore/test/sockios/client-wc.cc branches/complement-xmt/explore/test/sockios/close_socket.cc branches/complement-xmt/explore/test/sockios/sockios_test.cc branches/complement-xmt/explore/test/stem/Echo.h branches/complement-xmt/explore/test/stem/NameService.h branches/complement-xmt/explore/test/stem/Node.h branches/complement-xmt/explore/test/stem/NodeDL.h branches/complement-xmt/explore/test/stem/unit_test.cc Modified: branches/complement-xmt/explore/include/mt/shm.h =================================================================== --- branches/complement-xmt/explore/include/mt/shm.h 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/include/mt/shm.h 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/06/14 10:16:59 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 20:52:38 ptr> /* * Copyright (c) 2006, 2007 @@ -70,7 +70,7 @@ }; template <> -struct ipc_sharable<xmt::__Condition<true> > +struct ipc_sharable<xmt::__condition<true> > { typedef std::__true_type is_ipc_sharable; }; Modified: branches/complement-xmt/explore/include/mt/xmt.h =================================================================== --- branches/complement-xmt/explore/include/mt/xmt.h 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/include/mt/xmt.h 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/06/14 10:15:07 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 20:51:27 ptr> /* * Copyright (c) 1997-1999, 2002-2007 @@ -182,7 +182,7 @@ #endif // !_WIN32 -template <bool SCOPE> class __Condition; +template <bool SCOPE> class __condition; // if parameter SCOPE (process scope) true, PTHREAD_PROCESS_SHARED will // be used; otherwise PTHREAD_PROCESS_PRIVATE. @@ -264,7 +264,7 @@ #ifndef __FIT_WIN32THREADS private: - friend class __Condition<SCOPE>; + friend class __condition<SCOPE>; #endif }; @@ -365,7 +365,7 @@ #ifndef __FIT_WIN32THREADS private: - friend class __Condition<SCOPE>; + friend class __condition<SCOPE>; #endif }; @@ -968,10 +968,10 @@ }; template <bool SCOPE> -class __Condition +class __condition { public: - __Condition() : + __condition() : _val( true ) { #ifdef __FIT_WIN32THREADS @@ -993,7 +993,7 @@ #endif } - ~__Condition() + ~__condition() { #ifdef __FIT_WIN32THREADS CloseHandle( _cond ); @@ -1045,15 +1045,11 @@ int try_wait() { -#if defined(__FIT_WIN32THREADS) - _lock.lock(); -#endif -#if defined(__FIT_UITHREADS) || defined(_PTHREADS) basic_lock<__mutex<false,SCOPE> > _x1( _lock ); -#endif + if ( _val == false ) { #ifdef __FIT_WIN32THREADS - _lock.unlock(); + _x1.unlock(); if ( WaitForSingleObject( _cond, -1 ) == WAIT_FAILED ) { return -1; } @@ -1073,27 +1069,24 @@ return ret; #endif } -#if defined(__FIT_WIN32THREADS) - _lock.unlock(); -#endif + return 0; } int wait() { -#ifdef __FIT_WIN32THREADS - MT_LOCK( _lock ); + basic_lock<__mutex<false,SCOPE> > lk( _lock ); _val = false; + +#ifdef __FIT_WIN32THREADS ResetEvent( _cond ); - MT_UNLOCK( _lock ); + lk.unlock(); if ( WaitForSingleObject( _cond, -1 ) == WAIT_FAILED ) { return -1; } return 0; #endif #if defined(_PTHREADS) || defined(__FIT_UITHREADS) - basic_lock<__mutex<false,SCOPE> > lk( _lock ); - _val = false; int ret; while ( !_val ) { ret = @@ -1161,11 +1154,11 @@ bool _val; private: - __Condition( const __Condition& ) + __condition( const __condition& ) { } }; -typedef __Condition<false> Condition; +typedef __condition<false> condition; template <bool SCOPE> class __Semaphore @@ -1526,7 +1519,7 @@ # ifndef __hpux // sorry, POSIX threads don't have suspend/resume calls, so it should // be simulated via cond_wait - __Condition<false> _suspend; + __condition<false> _suspend; # endif #endif #ifdef __FIT_WIN32THREADS @@ -1549,7 +1542,7 @@ }; template <bool SCOPE> -int __Condition<SCOPE>::try_wait_time( const ::timespec *abstime ) +int __condition<SCOPE>::try_wait_time( const ::timespec *abstime ) { #if defined(__FIT_WIN32THREADS) MT_LOCK( _lock ); @@ -1605,7 +1598,7 @@ } template <bool SCOPE> -int __Condition<SCOPE>::try_wait_delay( const ::timespec *interval ) +int __condition<SCOPE>::try_wait_delay( const ::timespec *interval ) { #if defined(__FIT_WIN32THREADS) MT_LOCK( _lock ); @@ -1667,7 +1660,7 @@ } template <bool SCOPE> -int __Condition<SCOPE>::wait_time( const ::timespec *abstime ) +int __condition<SCOPE>::wait_time( const ::timespec *abstime ) { #ifdef __FIT_WIN32THREADS MT_LOCK( _lock ); @@ -1717,7 +1710,7 @@ } template <bool SCOPE> -int __Condition<SCOPE>::wait_delay( const ::timespec *interval ) +int __condition<SCOPE>::wait_delay( const ::timespec *interval ) { #ifdef __FIT_WIN32THREADS MT_LOCK( _lock ); Modified: branches/complement-xmt/explore/include/sockios/sockmgr.cc =================================================================== --- branches/complement-xmt/explore/include/sockios/sockmgr.cc 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/include/sockios/sockmgr.cc 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/02/01 19:50:14 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:14:42 ptr> /* * Copyright (c) 1997-1999, 2002, 2003, 2005-2007 @@ -29,7 +29,7 @@ template <class Connect> void sockmgr_stream_MP<Connect>::_open( sock_base::stype t ) { - MT_REENTRANT( _fd_lck, _1 ); + xmt::scoped_lock lk(_fd_lck); if ( is_open_unsafe() ) { if ( t == sock_base::sock_stream ) { _accept = &_Self_type::accept_tcp; @@ -204,7 +204,7 @@ } if ( _pfd[0].revents != 0 ) { - MT_REENTRANT( _fd_lck, _1 ); + xmt::scoped_lock lk(_fd_lck); if ( !is_open_unsafe() ) { // may be already closed return false; } @@ -224,7 +224,7 @@ if ( cl_new->s.rdbuf()->in_avail() > 0 ) { // this is the case when user read from sockstream // in ctor above; push processing of this stream - MT_REENTRANT( _dlock, _1 ); + xmt::scoped_lock lk(_dlock); _conn_pool.push_back( --_M_c.end() ); _pool_cnd.set( true ); _observer_cnd.set( true ); @@ -404,7 +404,7 @@ if ( stream.is_open() && stream.good() ) { if ( stream.rdbuf()->in_avail() > 0 ) { // socket has buffered data, push it back to queue - MT_REENTRANT( me->_dlock, _1 ); + xmt::scoped_lock lk(me->_dlock); me->_conn_pool.push_back( c ); me->_observer_cnd.set( true ); me->_pool_cnd.set( true ); @@ -428,7 +428,7 @@ for ( idle_count = 0; idle_count < 2; ++idle_count ) { { - MT_REENTRANT( me->_dlock, _1 ); + xmt::scoped_lock lk(me->_dlock); if ( !me->_follow ) { break; } @@ -481,7 +481,7 @@ // std::swap( pool_size[0], pool_size[1] ); std::rotate( pool_size, pool_size, pool_size + 3 ); { - MT_REENTRANT( me->_dlock, _1 ); + xmt::scoped_lock lk(me->_dlock); pool_size[2] = static_cast<int>(me->_conn_pool.size()); tpop = me->_tpop; } @@ -535,7 +535,7 @@ template <class Connect> void sockmgr_stream_MP_SELECT<Connect>::_open( sock_base::stype t ) { - MT_REENTRANT( _fd_lck, _1 ); + xmt::scoped_lock lk(_fd_lck); if ( is_open_unsafe() ) { if ( t == sock_base::sock_stream ) { _accept = &_Self_type::accept_tcp; @@ -655,11 +655,11 @@ FD_ZERO( &_pfde ); // *** Set all listen sockets here... - MT_LOCK( _fd_lck ); + _fd_lck.lock(); FD_SET( fd_unsafe(), &_pfdr ); FD_SET( fd_unsafe(), &_pfde ); _fdmax = fd_unsafe(); - MT_UNLOCK( _fd_lck ); + _fd_lck.unlock(); for ( typename container_type::iterator i = _M_c.begin(); i != _M_c.end(); ++i ) { if ( (*i)->s->is_open() ) { FD_SET( (*i)->s->rdbuf()->fd(), &_pfdr ); @@ -677,7 +677,7 @@ return 0; // poll wait infinite, so it can't return 0 (timeout), so it return -1. } - MT_REENTRANT( _fd_lck, _1 ); + xmt::scoped_lock lk(_fd_lck); if ( !is_open_unsafe() || FD_ISSET( fd_unsafe(), &_pfde ) ) { // may be already closed return 0; } Modified: branches/complement-xmt/explore/include/sockios/sockmgr.h =================================================================== --- branches/complement-xmt/explore/include/sockios/sockmgr.h 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/include/sockios/sockmgr.h 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/02/12 14:50:57 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 20:57:31 ptr> /* * Copyright (c) 1997-1999, 2002, 2003, 2005-2007 @@ -85,19 +85,19 @@ public: bool is_open() const - { MT_REENTRANT( _fd_lck, _1 ); return is_open_unsafe(); } + { xmt::scoped_lock lk(_fd_lck); return is_open_unsafe(); } bool good() const { return _state == ios_base::goodbit; } sock_base::socket_type fd() const - { MT_REENTRANT( _fd_lck, _1 ); return fd_unsafe(); } + { xmt::scoped_lock lk(_fd_lck); return fd_unsafe(); } __FIT_DECLSPEC void shutdown( sock_base::shutdownflg dir ); void setoptions( sock_base::so_t optname, bool on_off = true, int __v = 0 ) { - MT_REENTRANT( _fd_lck, _1 ); + xmt::scoped_lock lk(_fd_lck); setoptions_unsafe( optname, on_off, __v ); } @@ -114,7 +114,7 @@ protected: xmt::mutex _fd_lck; - xmt::Condition _loop_cnd; + xmt::condition _loop_cnd; }; class ConnectionProcessorTemplate_MP // As reference @@ -293,14 +293,14 @@ _fd_sequence _pfd; int _cfd; // sock_base::socket_type _connect_pool_sequence _conn_pool; - xmt::Condition _pool_cnd; + xmt::condition _pool_cnd; xmt::mutex _dlock; timespec _tpop; xmt::mutex _flock; bool _follow; - xmt::Condition _observer_cnd; + xmt::condition _observer_cnd; timespec _busylimit; // start new thread to process incoming // requests, if processing thread busy // more then _busylimit Modified: branches/complement-xmt/explore/include/stem/Cron.h =================================================================== --- branches/complement-xmt/explore/include/stem/Cron.h 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/include/stem/Cron.h 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,7 +1,7 @@ -// -*- C++ -*- Time-stamp: <06/12/15 03:20:55 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:20:12 ptr> /* - * Copyright (c) 1998, 2002, 2003, 2005 + * Copyright (c) 1998, 2002, 2003, 2005, 2007 * Petr Ovtchenkov * * Copyright (c) 1999-2001 @@ -18,9 +18,7 @@ #include <config/feature.h> #endif -#ifndef __IOSFWD__ #include <iosfwd> -#endif #ifndef __stem_EventHandler_h #include <stem/EventHandler.h> @@ -157,7 +155,7 @@ static xmt::Thread::ret_code _loop( void * ); xmt::Thread _thr; - xmt::Condition cond; + xmt::condition cond; typedef __CronEntry value_type; typedef std::priority_queue<value_type, Modified: branches/complement-xmt/explore/include/stem/EvManager.h =================================================================== --- branches/complement-xmt/explore/include/stem/EvManager.h 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/include/stem/EvManager.h 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/03/12 17:18:41 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:17:27 ptr> /* * Copyright (c) 1995-1999, 2002, 2003, 2005, 2006 @@ -123,31 +123,31 @@ bool is_avail( addr_type id ) const { - MT_REENTRANT( _lock_heap, _x1 ); + xmt::scoped_lock lk( _lock_heap ); return unsafe_is_avail(id); } const std::string who_is( addr_type id ) const { - MT_REENTRANT( _lock_iheap, _x1 ); + xmt::scoped_lock lk( _lock_iheap ); return unsafe_who_is( id ); } const std::string annotate( addr_type id ) const { - MT_REENTRANT( _lock_iheap, _x1 ); + xmt::scoped_lock lk( _lock_iheap ); return unsafe_annotate( id ); } void change_announce( addr_type id, const std::string& info ) { - MT_REENTRANT( _lock_iheap, _x1 ); + xmt::scoped_lock lk( _lock_iheap ); unsafe_change_announce( id, info ); } void change_announce( addr_type id, const char *info ) { - MT_REENTRANT( _lock_iheap, _x1 ); + xmt::scoped_lock lk( _lock_iheap ); unsafe_change_announce( id, info ); } @@ -155,7 +155,7 @@ void push( const Event& e ) { - MT_REENTRANT( _lock_queue, _x1 ); + xmt::scoped_lock lk( _lock_queue ); in_ev_queue.push_back( e ); _cnd_queue.set( true ); } @@ -253,7 +253,7 @@ xmt::mutex _lock_xheap; xmt::mutex _lock_queue; - xmt::Condition _cnd_queue; + xmt::condition _cnd_queue; static std::string inv_key_str; xmt::mutex _lock_tr; Modified: branches/complement-xmt/explore/lib/mt/ChangeLog =================================================================== --- branches/complement-xmt/explore/lib/mt/ChangeLog 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/lib/mt/ChangeLog 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,3 +1,7 @@ +2007-07-11 Petr Ovtchenkov <pt...@is...> + + * xmt.h, shm.h: Condition replaced by condition. + 2007-06-29 Petr Ovtchenkov <pt...@is...> * xmt.h, xmt.cc, uid.cc, thr_mgr.cc: replace Locker by scoped_lock. Modified: branches/complement-xmt/explore/lib/sockios/ChangeLog =================================================================== --- branches/complement-xmt/explore/lib/sockios/ChangeLog 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/lib/sockios/ChangeLog 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,3 +1,7 @@ +2007-07-11 Petr Ovtchenkov <pt...@is...> + + * sockmgr.h, sockmgr.cc: Condition replaced by condition. + 2007-06-29 Petr Ovtchenkov <pt...@is...> * sockmgr.cc, sockios_test.cc: replace Locker by scoped_lock. Modified: branches/complement-xmt/explore/lib/stem/ChangeLog =================================================================== --- branches/complement-xmt/explore/lib/stem/ChangeLog 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/lib/stem/ChangeLog 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,3 +1,7 @@ +2007-07-11 Petr Ovtchenkov <pt...@is...> + + * EvManager.h, Cron.h: Condition replaced by condition. + 2007-06-29 Petr Ovtchenkov <pt...@is...> * NetTransport.cc, EvManager.cc: replace Locker by scoped_lock. Modified: branches/complement-xmt/explore/test/mt/lfs.cc =================================================================== --- branches/complement-xmt/explore/test/mt/lfs.cc 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/test/mt/lfs.cc 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/12/15 10:44:27 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:22:41 ptr> /* * Copyright (c) 2004, 2006 @@ -30,7 +30,7 @@ static mutex m; static mutex b; static int cnt = 0; -static Condition cnd; +static condition cnd; static Thread::ret_code thread_func( void * ) { Modified: branches/complement-xmt/explore/test/mt/mt_test.cc =================================================================== --- branches/complement-xmt/explore/test/mt/mt_test.cc 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/test/mt/mt_test.cc 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/03/12 20:39:47 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:25:32 ptr> /* * Copyright (c) 2006, 2007 @@ -383,7 +383,7 @@ // cerr << "Error on shmat" << endl; // } - xmt::__Condition<true>& fcnd = *new( buf ) xmt::__Condition<true>(); + xmt::__condition<true>& fcnd = *new( buf ) xmt::__condition<true>(); fcnd.set( false ); try { @@ -414,7 +414,7 @@ catch ( ... ) { } - (&fcnd)->~__Condition<true>(); + (&fcnd)->~__condition<true>(); shmdt( buf ); shmctl( id, IPC_RMID, &ds ); @@ -440,7 +440,7 @@ // cerr << "Error on shmat" << endl; // } - xmt::__Condition<true>& fcnd = *new( buf ) xmt::__Condition<true>(); + xmt::__condition<true>& fcnd = *new( buf ) xmt::__condition<true>(); fcnd.set( false ); pid_t my_pid = xmt::getpid(); @@ -451,7 +451,7 @@ // Child code BOOST_CHECK( my_pid == xmt::getppid() ); - *reinterpret_cast<pid_t *>(static_cast<char *>(buf) + sizeof(xmt::__Condition<true>)) = xmt::getpid(); + *reinterpret_cast<pid_t *>(static_cast<char *>(buf) + sizeof(xmt::__condition<true>)) = xmt::getpid(); fcnd.set( true ); @@ -467,7 +467,7 @@ fcnd.try_wait(); - BOOST_CHECK( *reinterpret_cast<pid_t *>(static_cast<char *>(buf) + sizeof(xmt::__Condition<true>)) == child.pid() ); + BOOST_CHECK( *reinterpret_cast<pid_t *>(static_cast<char *>(buf) + sizeof(xmt::__condition<true>)) == child.pid() ); int stat; BOOST_CHECK( waitpid( child.pid(), &stat, 0 ) == child.pid() ); @@ -478,7 +478,7 @@ catch ( ... ) { } - (&fcnd)->~__Condition<true>(); + (&fcnd)->~__condition<true>(); shmdt( buf ); shmctl( id, IPC_RMID, &ds ); @@ -643,7 +643,7 @@ seg.allocate( fname, 1024, xmt::shm_base::create | xmt::shm_base::exclusive, 0660 ); xmt::allocator_shm<char,0> shm; - xmt::__Condition<true>& fcnd = *new( shm.allocate( sizeof(xmt::__Condition<true>) ) ) xmt::__Condition<true>(); + xmt::__condition<true>& fcnd = *new( shm.allocate( sizeof(xmt::__condition<true>) ) ) xmt::__condition<true>(); fcnd.set( false ); try { xmt::fork(); @@ -674,8 +674,8 @@ catch ( ... ) { } - (&fcnd)->~__Condition<true>(); - shm.deallocate( reinterpret_cast<char *>(&fcnd), sizeof(xmt::__Condition<true>) ); + (&fcnd)->~__condition<true>(); + shm.deallocate( reinterpret_cast<char *>(&fcnd), sizeof(xmt::__condition<true>) ); seg.deallocate(); fs::remove( fname ); } @@ -699,9 +699,9 @@ seg.allocate( fname, 4*4096, xmt::shm_base::create | xmt::shm_base::exclusive, 0660 ); xmt::shm_name_mgr<0>& nm = seg.name_mgr(); - xmt::allocator_shm<xmt::__Condition<true>,0> shm; + xmt::allocator_shm<xmt::__condition<true>,0> shm; - xmt::__Condition<true>& fcnd = *new ( shm.allocate( 1 ) ) xmt::__Condition<true>(); + xmt::__condition<true>& fcnd = *new ( shm.allocate( 1 ) ) xmt::__condition<true>(); nm.named( fcnd, test_Condition_Object ); fcnd.set( false ); @@ -722,7 +722,7 @@ } xmt::shm_name_mgr<0>& nm_ch = seg_ch.name_mgr(); - xmt::__Condition<true>& fcnd_ch = nm_ch.named<xmt::__Condition<true> >( test_Condition_Object ); + xmt::__condition<true>& fcnd_ch = nm_ch.named<xmt::__condition<true> >( test_Condition_Object ); fcnd_ch.set( true ); } catch ( const xmt::shm_bad_alloc& err ) { @@ -754,7 +754,7 @@ BOOST_CHECK_MESSAGE( false, "Fail in fork" ); } - (&fcnd)->~__Condition<true>(); + (&fcnd)->~__condition<true>(); shm.deallocate( &fcnd, 1 ); seg.deallocate(); fs::remove( fname ); @@ -794,9 +794,9 @@ try { xmt::shm_name_mgr<1>& nm = seg1.name_mgr(); - xmt::allocator_shm<xmt::__Condition<true>,1> shm; + xmt::allocator_shm<xmt::__condition<true>,1> shm; - xmt::__Condition<true>& fcnd = *new ( shm.allocate( 1 ) ) xmt::__Condition<true>(); + xmt::__condition<true>& fcnd = *new ( shm.allocate( 1 ) ) xmt::__condition<true>(); nm.named( fcnd, ObjName ); fcnd.set( false ); @@ -805,10 +805,10 @@ try { xmt::shm_name_mgr<1>& nm_ch = seg1.name_mgr(); - xmt::allocator_shm<xmt::__Condition<true>,1> shm_ch; - xmt::__Condition<true>& fcnd_ch = nm_ch.named<xmt::__Condition<true> >( ObjName ); + xmt::allocator_shm<xmt::__condition<true>,1> shm_ch; + xmt::__condition<true>& fcnd_ch = nm_ch.named<xmt::__condition<true> >( ObjName ); fcnd_ch.set( true ); - nm_ch.release<xmt::__Condition<true> >( ObjName ); + nm_ch.release<xmt::__condition<true> >( ObjName ); } catch ( const std::invalid_argument& err ) { BOOST_CHECK_MESSAGE( false, "error report: " << err.what() ); @@ -820,9 +820,9 @@ int stat; BOOST_CHECK( waitpid( child.pid(), &stat, 0 ) == child.pid() ); } - nm.release<xmt::__Condition<true> >( ObjName ); // fcnd should be destroyed here + nm.release<xmt::__condition<true> >( ObjName ); // fcnd should be destroyed here - xmt::__Condition<true>& fcnd1 = *new ( shm.allocate( 1 ) ) xmt::__Condition<true>(); + xmt::__condition<true>& fcnd1 = *new ( shm.allocate( 1 ) ) xmt::__condition<true>(); nm.named( fcnd1, ObjName ); // ObjName should be free here fcnd1.set( false ); @@ -831,10 +831,10 @@ try { xmt::shm_name_mgr<1>& nm_ch = seg1.name_mgr(); - xmt::allocator_shm<xmt::__Condition<true>,1> shm_ch; - xmt::__Condition<true>& fcnd_ch = nm_ch.named<xmt::__Condition<true> >( ObjName ); + xmt::allocator_shm<xmt::__condition<true>,1> shm_ch; + xmt::__condition<true>& fcnd_ch = nm_ch.named<xmt::__condition<true> >( ObjName ); fcnd_ch.set( true ); - nm_ch.release<xmt::__Condition<true> >( ObjName ); + nm_ch.release<xmt::__condition<true> >( ObjName ); } catch ( const std::invalid_argument& err ) { BOOST_CHECK_MESSAGE( false, "error report: " << err.what() ); @@ -847,7 +847,7 @@ int stat; BOOST_CHECK( waitpid( child.pid(), &stat, 0 ) == child.pid() ); } - nm.release<xmt::__Condition<true> >( ObjName ); // fcnd should be destroyed here + nm.release<xmt::__condition<true> >( ObjName ); // fcnd should be destroyed here xmt::allocator_shm<xmt::__Barrier<true>,1> shm_b; xmt::__Barrier<true>& b = *new ( shm_b.allocate( 1 ) ) xmt::__Barrier<true>(); Modified: branches/complement-xmt/explore/test/mt/signal-1.cc =================================================================== --- branches/complement-xmt/explore/test/mt/signal-1.cc 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/test/mt/signal-1.cc 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/12/16 00:28:34 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:21:38 ptr> /* * Copyright (c) 2003, 2006 @@ -33,7 +33,7 @@ static int v = 0; -static Condition cnd; +static condition cnd; extern "C" { static void handler( int ); Modified: branches/complement-xmt/explore/test/mt/signal-3.cc =================================================================== --- branches/complement-xmt/explore/test/mt/signal-3.cc 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/test/mt/signal-3.cc 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/12/16 00:35:45 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:22:05 ptr> /* * Copyright (c) 2003, 2006 @@ -38,7 +38,7 @@ static int v = 0; -static Condition cnd; +static condition cnd; extern "C" { static void handler( int ); Modified: branches/complement-xmt/explore/test/sockios/bytes_in_socket.cc =================================================================== --- branches/complement-xmt/explore/test/sockios/bytes_in_socket.cc 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/test/sockios/bytes_in_socket.cc 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/10/10 20:35:08 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:35:39 ptr> /* * @@ -43,7 +43,7 @@ extern int port; extern xmt::mutex pr_lock; -static Condition cnd; +static condition cnd; class ConnectionProcessor4 // dummy variant { Modified: branches/complement-xmt/explore/test/sockios/bytes_in_socket2.cc =================================================================== --- branches/complement-xmt/explore/test/sockios/bytes_in_socket2.cc 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/test/sockios/bytes_in_socket2.cc 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/10/10 21:31:27 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:36:14 ptr> /* * @@ -34,7 +34,7 @@ extern int port; extern xmt::mutex pr_lock; -static Condition cnd; +static condition cnd; class ConnectionProcessor7 // dummy variant { Modified: branches/complement-xmt/explore/test/sockios/client-wc.cc =================================================================== --- branches/complement-xmt/explore/test/sockios/client-wc.cc 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/test/sockios/client-wc.cc 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/01/29 17:48:29 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:34:07 ptr> /* * Copyright (c) 2004, 2006 @@ -28,7 +28,7 @@ Suspicious processing with FreeBSD and OpenBSD servers. */ -static Condition cnd_close; +static condition cnd_close; class Srv // { @@ -67,7 +67,7 @@ #endif static srv_type *srv_p; -Condition cnd; +condition cnd; Thread::ret_code server_proc( void * ) { Modified: branches/complement-xmt/explore/test/sockios/close_socket.cc =================================================================== --- branches/complement-xmt/explore/test/sockios/close_socket.cc 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/test/sockios/close_socket.cc 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/08/04 12:03:39 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:34:53 ptr> /* * @@ -64,7 +64,7 @@ // with Input line prompt } -Condition cnd2; +condition cnd2; void ConnectionProcessor3::connect( std::sockstream& s ) { @@ -103,7 +103,7 @@ pr_lock.unlock(); } -Condition cnd1; +condition cnd1; // Condition cnd2; std::sockstream *psock = 0; Modified: branches/complement-xmt/explore/test/sockios/sockios_test.cc =================================================================== --- branches/complement-xmt/explore/test/sockios/sockios_test.cc 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/test/sockios/sockios_test.cc 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/02/26 17:18:51 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:40:23 ptr> /* * @@ -26,7 +26,7 @@ const char fname[] = "/tmp/sockios_test.shm"; xmt::shm_alloc<0> seg; -xmt::allocator_shm<xmt::__Condition<true>,0> shm_cnd; +xmt::allocator_shm<xmt::__condition<true>,0> shm_cnd; xmt::allocator_shm<xmt::__Barrier<true>,0> shm_b; sockios_test::sockios_test() @@ -228,10 +228,10 @@ void sockios_test::sigpipe() { try { - xmt::__Condition<true>& fcnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__Condition<true>(); + xmt::__condition<true>& fcnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__condition<true>(); fcnd.set( false ); - xmt::__Condition<true>& tcnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__Condition<true>(); + xmt::__condition<true>& tcnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__condition<true>(); tcnd.set( false ); try { @@ -284,9 +284,9 @@ } } - (&tcnd)->~__Condition<true>(); + (&tcnd)->~__condition<true>(); shm_cnd.deallocate( &tcnd, 1 ); - (&fcnd)->~__Condition<true>(); + (&fcnd)->~__condition<true>(); shm_cnd.deallocate( &fcnd, 1 ); } catch ( xmt::shm_bad_alloc& err ) { @@ -304,7 +304,7 @@ void connect( std::sockstream& ); void close(); - static xmt::__Condition<true> *cnd; + static xmt::__condition<true> *cnd; }; long_msg_processor::long_msg_processor( std::sockstream& ) @@ -329,15 +329,15 @@ cnd->set( true ); } -xmt::__Condition<true> *long_msg_processor::cnd; +xmt::__condition<true> *long_msg_processor::cnd; void sockios_test::long_msg() { try { - xmt::__Condition<true>& fcnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__Condition<true>(); + xmt::__condition<true>& fcnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__condition<true>(); fcnd.set( false ); - xmt::__Condition<true>& srv_cnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__Condition<true>(); + xmt::__condition<true>& srv_cnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__condition<true>(); srv_cnd.set( false ); long_msg_processor::cnd = &srv_cnd; @@ -380,10 +380,10 @@ } - (&fcnd)->~__Condition<true>(); + (&fcnd)->~__condition<true>(); shm_cnd.deallocate( &fcnd, 1 ); - (&srv_cnd)->~__Condition<true>(); + (&srv_cnd)->~__condition<true>(); shm_cnd.deallocate( &srv_cnd, 1 ); } catch ( xmt::shm_bad_alloc& err ) { @@ -469,7 +469,7 @@ xmt::Thread::ret_code thread_entry( void *par ) { xmt::Thread::ret_code rt; - xmt::Condition& cnd = *reinterpret_cast<xmt::Condition *>(par); + xmt::condition& cnd = *reinterpret_cast<xmt::condition *>(par); // sem.wait(); // wait server for listen us sockstream sock( "localhost", ::port ); @@ -489,7 +489,7 @@ void sockios_test::read0() { try { - xmt::__Condition<true>& fcnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__Condition<true>(); + xmt::__condition<true>& fcnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__condition<true>(); xmt::__Barrier<true>& b = *new ( shm_b.allocate( 1 ) ) xmt::__Barrier<true>(); ConnectionProcessor5::b = &b; // nm.named( fcnd, 1 ); @@ -499,7 +499,7 @@ xmt::fork(); // <---- key line fcnd.try_wait(); // wait server for listen us - xmt::Condition cnd; + xmt::condition cnd; cnd.set( false ); xmt::Thread thr( thread_entry, &cnd ); @@ -532,7 +532,7 @@ (&b)->~__Barrier<true>(); shm_b.deallocate( &b, 1 ); - (&fcnd)->~__Condition<true>(); + (&fcnd)->~__condition<true>(); shm_cnd.deallocate( &fcnd, 1 ); } catch ( xmt::shm_bad_alloc& err ) { @@ -550,10 +550,10 @@ void connect( std::sockstream& ); void close(); - static xmt::Condition cnd; + static xmt::condition cnd; }; -xmt::Condition ConnectionProcessor6::cnd; +xmt::condition ConnectionProcessor6::cnd; ConnectionProcessor6::ConnectionProcessor6( std::sockstream& s ) { @@ -633,10 +633,10 @@ void connect( std::sockstream& ); void close(); - static xmt::Condition cnd; + static xmt::condition cnd; }; -xmt::Condition LongBlockReader::cnd; +xmt::condition LongBlockReader::cnd; LongBlockReader::LongBlockReader( std::sockstream& s ) { Modified: branches/complement-xmt/explore/test/stem/Echo.h =================================================================== --- branches/complement-xmt/explore/test/stem/Echo.h 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/test/stem/Echo.h 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/10/11 00:56:13 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:45:09 ptr> /* * Copyright (c) 2006 @@ -28,7 +28,7 @@ void echo( const stem::Event& ); void regme( const stem::Event& ); - xmt::Condition cnd; + xmt::condition cnd; private: DECLARE_RESPONSE_TABLE( StEMecho, stem::EventHandler ); @@ -50,7 +50,7 @@ const std::string mess; private: - xmt::Condition cnd; + xmt::condition cnd; DECLARE_RESPONSE_TABLE( EchoClient, stem::EventHandler ); }; @@ -72,7 +72,7 @@ const std::string mess; private: - xmt::Condition cnd; + xmt::condition cnd; DECLARE_RESPONSE_TABLE( PeerClient, stem::EventHandler ); }; Modified: branches/complement-xmt/explore/test/stem/NameService.h =================================================================== --- branches/complement-xmt/explore/test/stem/NameService.h 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/test/stem/NameService.h 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/11/24 19:33:11 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:47:37 ptr> /* * Copyright (c) 2006 @@ -36,7 +36,7 @@ nsrecords_type::container_type lst; private: - xmt::Condition cnd; + xmt::condition cnd; DECLARE_RESPONSE_TABLE( Naming, stem::EventHandler ); }; Modified: branches/complement-xmt/explore/test/stem/Node.h =================================================================== --- branches/complement-xmt/explore/test/stem/Node.h 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/test/stem/Node.h 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/09/29 22:53:43 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:47:25 ptr> /* * @@ -31,7 +31,7 @@ int v; private: - xmt::Condition cnd; + xmt::condition cnd; DECLARE_RESPONSE_TABLE( Node, stem::EventHandler ); }; @@ -52,7 +52,7 @@ int v; private: - xmt::Condition cnd; + xmt::condition cnd; DECLARE_RESPONSE_TABLE( NewNode, stem::EventHandler ); }; Modified: branches/complement-xmt/explore/test/stem/NodeDL.h =================================================================== --- branches/complement-xmt/explore/test/stem/NodeDL.h 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/test/stem/NodeDL.h 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <06/09/29 22:50:51 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:47:58 ptr> /* * @@ -30,7 +30,7 @@ int v; private: - xmt::Condition cnd; + xmt::condition cnd; DECLARE_RESPONSE_TABLE( NodeDL, stem::EventHandler ); }; @@ -51,7 +51,7 @@ int v; private: - xmt::Condition cnd; + xmt::condition cnd; DECLARE_RESPONSE_TABLE( NewNodeDL, stem::EventHandler ); }; Modified: branches/complement-xmt/explore/test/stem/unit_test.cc =================================================================== --- branches/complement-xmt/explore/test/stem/unit_test.cc 2007-07-11 07:35:11 UTC (rev 1602) +++ branches/complement-xmt/explore/test/stem/unit_test.cc 2007-07-11 17:56:00 UTC (rev 1603) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/03/12 21:20:54 ptr> +// -*- C++ -*- Time-stamp: <07/07/11 21:46:57 ptr> /* * Copyright (c) 2002, 2003, 2006 @@ -295,7 +295,7 @@ const char fname[] = "/tmp/stem_test.shm"; xmt::shm_alloc<0> seg; -xmt::allocator_shm<xmt::__Condition<true>,0> shm_cnd; +xmt::allocator_shm<xmt::__condition<true>,0> shm_cnd; xmt::allocator_shm<xmt::__Barrier<true>,0> shm_b; void stem_test::shm_init() @@ -316,7 +316,7 @@ void stem_test::echo_net() { - xmt::__Condition<true>& fcnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__Condition<true>(); + xmt::__condition<true>& fcnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__condition<true>(); fcnd.set( false ); try { @@ -369,7 +369,7 @@ } } - (&fcnd)->~__Condition<true>(); + (&fcnd)->~__condition<true>(); shm_cnd.deallocate( &fcnd, 1 ); // cerr << "Fine\n"; @@ -381,7 +381,7 @@ { try { xmt::__Barrier<true>& b = *new ( shm_b.allocate( 1 ) ) xmt::__Barrier<true>(); - xmt::__Condition<true>& c = *new ( shm_cnd.allocate( 1 ) ) xmt::__Condition<true>(); + xmt::__condition<true>& c = *new ( shm_cnd.allocate( 1 ) ) xmt::__condition<true>(); c.set( false ); @@ -439,7 +439,7 @@ BOOST_CHECK( waitpid( child.pid(), &stat, 0 ) == child.pid() ); } - (&c)->~__Condition<true>(); + (&c)->~__condition<true>(); shm_cnd.deallocate( &c, 1 ); (&b)->~__Barrier<true>(); shm_b.deallocate( &b, 1 ); @@ -477,13 +477,13 @@ pid_t fpid; - xmt::__Condition<true>& fcnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__Condition<true>(); + xmt::__condition<true>& fcnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__condition<true>(); fcnd.set( false ); - xmt::__Condition<true>& pcnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__Condition<true>(); + xmt::__condition<true>& pcnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__condition<true>(); pcnd.set( false ); - xmt::__Condition<true>& scnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__Condition<true>(); + xmt::__condition<true>& scnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__condition<true>(); scnd.set( false ); try { @@ -653,17 +653,17 @@ srv.wait(); } - (&fcnd)->~__Condition<true>(); + (&fcnd)->~__condition<true>(); shm_cnd.deallocate( &fcnd, 1 ); - (&pcnd)->~__Condition<true>(); + (&pcnd)->~__condition<true>(); shm_cnd.deallocate( &pcnd, 1 ); - (&scnd)->~__Condition<true>(); + (&scnd)->~__condition<true>(); shm_cnd.deallocate( &scnd, 1 ); } void stem_test::boring_manager() { - xmt::__Condition<true>& fcnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__Condition<true>(); + xmt::__condition<true>& fcnd = *new ( shm_cnd.allocate( 1 ) ) xmt::__condition<true>(); fcnd.set( false ); try { @@ -707,7 +707,7 @@ srv.wait(); } - (&fcnd)->~__Condition<true>(); + (&fcnd)->~__condition<true>(); shm_cnd.deallocate( &fcnd, 1 ); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |