raw
This commit is contained in:
27
Thirdparty/Pangolin/include/pangolin/utils/posix/condition_variable.h
vendored
Normal file
27
Thirdparty/Pangolin/include/pangolin/utils/posix/condition_variable.h
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include <pangolin/utils/timer.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace pangolin
|
||||
{
|
||||
|
||||
class ConditionVariableInterface
|
||||
{
|
||||
public:
|
||||
virtual ~ConditionVariableInterface()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void wait() = 0;
|
||||
virtual bool wait(timespec t) = 0;
|
||||
virtual void signal() = 0;
|
||||
virtual void broadcast() = 0;
|
||||
};
|
||||
|
||||
std::shared_ptr<ConditionVariableInterface> create_named_condition_variable(const
|
||||
std::string& name);
|
||||
std::shared_ptr<ConditionVariableInterface> open_named_condition_variable(const
|
||||
std::string& name);
|
||||
}
|
||||
26
Thirdparty/Pangolin/include/pangolin/utils/posix/semaphore.h
vendored
Normal file
26
Thirdparty/Pangolin/include/pangolin/utils/posix/semaphore.h
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace pangolin
|
||||
{
|
||||
|
||||
class SemaphoreInterface
|
||||
{
|
||||
public:
|
||||
|
||||
virtual ~SemaphoreInterface() {
|
||||
}
|
||||
|
||||
virtual bool tryAcquire() = 0;
|
||||
virtual void acquire() = 0;
|
||||
virtual void release() = 0;
|
||||
};
|
||||
|
||||
std::shared_ptr<SemaphoreInterface> create_named_semaphore(const std::string& name,
|
||||
unsigned int value);
|
||||
std::shared_ptr<SemaphoreInterface> open_named_semaphore(const std::string& name);
|
||||
|
||||
}
|
||||
25
Thirdparty/Pangolin/include/pangolin/utils/posix/shared_memory_buffer.h
vendored
Normal file
25
Thirdparty/Pangolin/include/pangolin/utils/posix/shared_memory_buffer.h
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace pangolin
|
||||
{
|
||||
class SharedMemoryBufferInterface
|
||||
{
|
||||
public:
|
||||
virtual ~SharedMemoryBufferInterface() {
|
||||
}
|
||||
virtual bool tryLock() = 0;
|
||||
virtual void lock() = 0;
|
||||
virtual void unlock() = 0;
|
||||
virtual unsigned char *ptr() = 0;
|
||||
virtual std::string name() = 0;
|
||||
};
|
||||
|
||||
std::shared_ptr<SharedMemoryBufferInterface> create_named_shared_memory_buffer(const
|
||||
std::string& name, size_t size);
|
||||
std::shared_ptr<SharedMemoryBufferInterface> open_named_shared_memory_buffer(const
|
||||
std::string& name, bool readwrite);
|
||||
}
|
||||
Reference in New Issue
Block a user