[complement-svn] SF.net SVN: complement: [1523] trunk/complement/explore/test/mt
Status: Pre-Alpha
Brought to you by:
complement
From: <com...@us...> - 2007-02-09 13:57:53
|
Revision: 1523 http://svn.sourceforge.net/complement/?rev=1523&view=rev Author: complement Date: 2007-02-09 05:57:52 -0800 (Fri, 09 Feb 2007) Log Message: ----------- add shm_init/finit, for future use Modified Paths: -------------- trunk/complement/explore/test/mt/mt_test.cc trunk/complement/explore/test/mt/mt_test.h trunk/complement/explore/test/mt/mt_test_suite.cc Modified: trunk/complement/explore/test/mt/mt_test.cc =================================================================== --- trunk/complement/explore/test/mt/mt_test.cc 2007-02-09 10:34:41 UTC (rev 1522) +++ trunk/complement/explore/test/mt/mt_test.cc 2007-02-09 13:57:52 UTC (rev 1523) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/02/07 08:29:41 ptr> +// -*- C++ -*- Time-stamp: <07/02/09 15:55:31 ptr> /* * Copyright (c) 2006, 2007 @@ -764,8 +764,25 @@ } } +/* ****************************************************** + */ +static const char fname1[] = "/tmp/mt_test.shm.1"; +xmt::shm_alloc<1> seg1; +void mt_test::shm_init() +{ + seg.allocate( fname1, 4*4096, xmt::shm_base::create | xmt::shm_base::exclusive, 0660 ); +} + /* ****************************************************** + */ +void mt_test::shm_finit() +{ + seg1.deallocate(); + fs::remove( fname1 ); +} + +/* ****************************************************** * Thread pool (aka ThreadMgr) test. * * Start 200 threads under ThreadMgr; check that all threads Modified: trunk/complement/explore/test/mt/mt_test.h =================================================================== --- trunk/complement/explore/test/mt/mt_test.h 2007-02-09 10:34:41 UTC (rev 1522) +++ trunk/complement/explore/test/mt/mt_test.h 2007-02-09 13:57:52 UTC (rev 1523) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/02/06 09:48:27 ptr> +// -*- C++ -*- Time-stamp: <07/02/09 15:56:27 ptr> /* * Copyright (c) 2006, 2007 @@ -30,6 +30,9 @@ void shm_named_obj(); void thr_mgr(); + void shm_init(); + void shm_finit(); + private: // static xmt::Thread::ret_code thread_entry_call( void * ); // static int x; Modified: trunk/complement/explore/test/mt/mt_test_suite.cc =================================================================== --- trunk/complement/explore/test/mt/mt_test_suite.cc 2007-02-09 10:34:41 UTC (rev 1522) +++ trunk/complement/explore/test/mt/mt_test_suite.cc 2007-02-09 13:57:52 UTC (rev 1523) @@ -1,4 +1,4 @@ -// -*- C++ -*- Time-stamp: <07/02/06 10:06:37 ptr> +// -*- C++ -*- Time-stamp: <07/02/09 16:00:57 ptr> /* * Copyright (c) 2006, 2007 @@ -38,6 +38,9 @@ test_case *thr_mgr_tc = BOOST_CLASS_TEST_CASE( &mt_test::thr_mgr, instance ); + test_case *shm_init_tc = BOOST_CLASS_TEST_CASE( &mt_test::shm_init_mgr, instance ); + test_case *shm_finit_tc = BOOST_CLASS_TEST_CASE( &mt_test::shm_finit_mgr, instance ); + barrier2_tc->depends_on( barrier_tc ); barrier2_tc->depends_on( join_tc ); yield_tc->depends_on( barrier2_tc ); @@ -52,6 +55,9 @@ fork_shm_tc->depends_on( shm_alloc_tc ); shm_nm_obj_tc->depends_on( fork_shm_tc ); + shm_init_tc->depends_on( shm_alloc_tc ); + shm_finit_tc->depends_on( shm_init_tc ); + add( barrier_tc, 0, 2 ); add( join_tc ); add( barrier2_tc, 0, 3 ); @@ -70,4 +76,7 @@ add( shm_nm_obj_tc, 0, 5 ); add( thr_mgr_tc ); + + add( shm_init_tc ); + add( shm_finit_tc ); }; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |