Gromacs  2020.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Typedefs | Functions | Variables
gmx::test::anonymous_namespace{mutex.cpp} Namespace Reference

Classes

class  DifferentTasksTest
 Parameterized test fixture. More...
 

Typedefs

using Lock = gmx::lock_guard< Mutex >
 Convenience definition.
 
using TaskType = std::function< int(void)>
 Function type for asynchronous tasks.
 

Functions

int updateSharedValue ()
 A task that just does work.
 
int updateSharedValueWithLock ()
 A task that does work after it gets the mutex.
 
int updateSharedValueWithTryLock ()
 A task that does work only if it can get the mutex immediately.
 

Variables

int g_sharedValue
 A shared value for a mutex to protect.
 
Mutex g_sharedValueMutex
 A mutex to protect a shared value.