mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-08-06 10:27:34 +00:00
Add mutex interface
This commit is contained in:
27
include/sta/mutex.hpp
Normal file
27
include/sta/mutex.hpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef STA_MUTEX_HPP
|
||||
#define STA_MUTEX_HPP
|
||||
|
||||
|
||||
namespace sta
|
||||
{
|
||||
/**
|
||||
* @brief Interface for mutex objects.
|
||||
*/
|
||||
class Mutex
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* @brief Block until mutex has been acquired
|
||||
*/
|
||||
virtual void acquire() = 0;
|
||||
/**
|
||||
* @brief Release mutex
|
||||
*/
|
||||
virtual void release() = 0;
|
||||
|
||||
static Mutex * ALWAYS_FREE; /**< Fake mutex that can always be acquired */
|
||||
};
|
||||
} // namespace sta
|
||||
|
||||
|
||||
#endif // STA_MUTEX_HPP
|
Reference in New Issue
Block a user