|
Last change
on this file since 039e15 was 039e15, checked in by Frederik Heber <heber@…>, 9 years ago |
|
Added AtomicInstance as a mutex-locked wrapper around a given entity.
- this should help in multi-threaded codes to prevent accessing the entity from
more than one thread at once: Lock the entity by accessing it within a scope
while wrapped in AtomicInstance.
|
-
Property mode
set to
100644
|
|
File size:
623 bytes
|
| Line | |
|---|
| 1 | /*
|
|---|
| 2 | * AtomicInstanceUnitTest.hpp
|
|---|
| 3 | *
|
|---|
| 4 | * Created on: Apr 26, 2016
|
|---|
| 5 | * Author: heber
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| 8 | #ifndef ATOMICINSTANCEUNITTEST_HPP_
|
|---|
| 9 | #define ATOMICINSTANCEUNITTEST_HPP_
|
|---|
| 10 |
|
|---|
| 11 | // include config.h
|
|---|
| 12 | #ifdef HAVE_CONFIG_H
|
|---|
| 13 | #include <config.h>
|
|---|
| 14 | #endif
|
|---|
| 15 |
|
|---|
| 16 | #include <cppunit/extensions/HelperMacros.h>
|
|---|
| 17 |
|
|---|
| 18 | class AtomicInstanceTest : public CppUnit::TestFixture
|
|---|
| 19 | {
|
|---|
| 20 | CPPUNIT_TEST_SUITE( AtomicInstanceTest );
|
|---|
| 21 | CPPUNIT_TEST ( ConstructionTest );
|
|---|
| 22 | CPPUNIT_TEST ( AssignmentTest );
|
|---|
| 23 | CPPUNIT_TEST_SUITE_END();
|
|---|
| 24 |
|
|---|
| 25 | public:
|
|---|
| 26 | void setUp();
|
|---|
| 27 | void tearDown();
|
|---|
| 28 |
|
|---|
| 29 | void ConstructionTest();
|
|---|
| 30 | void AssignmentTest();
|
|---|
| 31 | };
|
|---|
| 32 |
|
|---|
| 33 | #endif /* ATOMICINSTANCEUNITTEST_HPP_ */
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.