diff options
Diffstat (limited to 'examples/Shared_Malloc')
-rw-r--r-- | examples/Shared_Malloc/Malloc.cpp | 34 | ||||
-rw-r--r-- | examples/Shared_Malloc/test_persistence.cpp | 3 |
2 files changed, 14 insertions, 23 deletions
diff --git a/examples/Shared_Malloc/Malloc.cpp b/examples/Shared_Malloc/Malloc.cpp index c0ddc352df5..403d8325b23 100644 --- a/examples/Shared_Malloc/Malloc.cpp +++ b/examples/Shared_Malloc/Malloc.cpp @@ -3,30 +3,23 @@ #include "Malloc.h" -// Determine the type of dynamic memory manager. -#if defined (ACE_HAS_THREADS) -typedef ACE_Thread_Mutex THREAD_MUTEX; -#else -typedef ACE_Null_Mutex THREAD_MUTEX; -#endif /* ACE_HAS_THREADS */ - // Strategic typedefs for memory allocation. -typedef ACE_Malloc <ACE_LOCAL_MEMORY_POOL, THREAD_MUTEX> L_ALLOCATOR; +typedef ACE_Malloc <ACE_LOCAL_MEMORY_POOL, ACE_SYNCH_MUTEX> L_ALLOCATOR; typedef ACE_Malloc <ACE_MMAP_MEMORY_POOL, ACE_Process_Mutex> M_ALLOCATOR; #if defined (ACE_LACKS_SYSV_SHMEM) -typedef ACE_Malloc <ACE_MMAP_MEMORY_POOL, THREAD_MUTEX> SP_ALLOCATOR; -typedef ACE_Malloc <ACE_MMAP_MEMORY_POOL, THREAD_MUTEX> ST_ALLOCATOR; +typedef ACE_Malloc <ACE_MMAP_MEMORY_POOL, ACE_SYNCH_MUTEX> SP_ALLOCATOR; +typedef ACE_Malloc <ACE_MMAP_MEMORY_POOL, ACE_SYNCH_MUTEX> ST_ALLOCATOR; #else typedef ACE_Malloc <ACE_SHARED_MEMORY_POOL, ACE_Process_Mutex> SP_ALLOCATOR; -typedef ACE_Malloc <ACE_SHARED_MEMORY_POOL, THREAD_MUTEX> ST_ALLOCATOR; +typedef ACE_Malloc <ACE_SHARED_MEMORY_POOL, ACE_SYNCH_MUTEX> ST_ALLOCATOR; #endif /* ACE_LACKS_SYSV_SHMEM */ #if defined (ACE_LACKS_SBRK) -typedef ACE_Malloc <ACE_LOCAL_MEMORY_POOL, THREAD_MUTEX> SB_ALLOCATOR; +typedef ACE_Malloc <ACE_LOCAL_MEMORY_POOL, ACE_SYNCH_MUTEX> SB_ALLOCATOR; #else -typedef ACE_Malloc <ACE_SBRK_MEMORY_POOL, THREAD_MUTEX> SB_ALLOCATOR; +typedef ACE_Malloc <ACE_SBRK_MEMORY_POOL, ACE_SYNCH_MUTEX> SB_ALLOCATOR; #endif /* ACE_LACKS_SBRK */ // Singleton @@ -59,7 +52,6 @@ Malloc::instance (void) return Malloc::instance_; } - #if defined (ACE_TEMPLATES_REQUIRE_SPECIALIZATION) template class ACE_Allocator_Adapter<L_ALLOCATOR>; template class ACE_Allocator_Adapter<M_ALLOCATOR>; @@ -67,23 +59,23 @@ template class ACE_Allocator_Adapter<SB_ALLOCATOR>; template class ACE_Allocator_Adapter<SP_ALLOCATOR>; template class ACE_Allocator_Adapter<ST_ALLOCATOR>; template class ACE_Guard<ACE_Process_Mutex>; -template class ACE_Malloc <ACE_LOCAL_MEMORY_POOL, THREAD_MUTEX>; +template class ACE_Malloc <ACE_LOCAL_MEMORY_POOL, ACE_SYNCH_MUTEX>; template class ACE_Malloc <ACE_MMAP_MEMORY_POOL, ACE_Process_Mutex>; template class ACE_Read_Guard<ACE_Process_Mutex>; -template class ACE_Read_Guard<THREAD_MUTEX>; +template class ACE_Read_Guard<ACE_SYNCH_MUTEX>; template class ACE_Write_Guard<ACE_Process_Mutex>; -template class ACE_Write_Guard<THREAD_MUTEX>; +template class ACE_Write_Guard<ACE_SYNCH_MUTEX>; #if defined (ACE_LACKS_SYSV_SHMEM) -template class ACE_Malloc <ACE_MMAP_MEMORY_POOL, THREAD_MUTEX>; +template class ACE_Malloc <ACE_MMAP_MEMORY_POOL, ACE_SYNCH_MUTEX>; #else template class ACE_Malloc <ACE_SHARED_MEMORY_POOL, ACE_Process_Mutex>; -template class ACE_Malloc <ACE_SHARED_MEMORY_POOL, THREAD_MUTEX>; +template class ACE_Malloc <ACE_SHARED_MEMORY_POOL, ACE_SYNCH_MUTEX>; #endif /* ACE_LACKS_SYSV_SHMEM */ #if defined (ACE_LACKS_SBRK) -template class ACE_Malloc <ACE_LOCAL_MEMORY_POOL, THREAD_MUTEX>; +template class ACE_Malloc <ACE_LOCAL_MEMORY_POOL, ACE_SYNCH_MUTEX>; #else -template class ACE_Malloc <ACE_SBRK_MEMORY_POOL, THREAD_MUTEX>; +template class ACE_Malloc <ACE_SBRK_MEMORY_POOL, ACE_SYNCH_MUTEX>; #endif /* ACE_LACKS_SBRK */ #endif /* ACE_TEMPLATES_REQUIRE_SPECIALIZATION */ diff --git a/examples/Shared_Malloc/test_persistence.cpp b/examples/Shared_Malloc/test_persistence.cpp index 1afef0a4a60..bacef7f9c58 100644 --- a/examples/Shared_Malloc/test_persistence.cpp +++ b/examples/Shared_Malloc/test_persistence.cpp @@ -1,7 +1,6 @@ -// Test the persistence capabilities of the ACE shared memory manager. // $Id$ - +// Test the persistence capabilities of the ACE shared memory manager. #include "ace/Malloc.h" |