- Test:
- use the lib::Thread wrapper for simplified definition of the thread-function, argument binding and starting of threads.
- See also
- thread.hpp
-
ThreadWrapperJoin_test
-
SyncLocking_test
Definition at line 62 of file thread-wrapper-test.cpp.
|
virtual void | run (Arg arg)=0 |
|
◆ demonstrateSimpleUsage()
void demonstrateSimpleUsage |
( |
| ) |
|
|
inlineprivate |
◆ verifyConcurrentExecution()
void verifyConcurrentExecution |
( |
| ) |
|
|
inlineprivate |
- Test:
- verify the thread function is actually performed concurrently
- use a derived Thread object, also holding a local data field
- the thread function sleeps, and then stores the sum of two numbers
- demonstrate that each instance can have a different argument binding
- verify each thread function has actually been invoked once per thread, by comparing a local sum with values collected from the Thread objects,
- moreover measure the overall time required for launching the threads and then waiting for all threads to have terminated and detached; this time must be shorter than all the average sleep times compounded (as if the function was invoked sequentially).
< the actual operation running in a separate thread
Definition at line 98 of file thread-wrapper-test.cpp.
The documentation for this class was generated from the following file: