mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-14 04:57:21 +01:00
28 lines
435 B
C++
28 lines
435 B
C++
#ifndef SHARED_RESOURCE_H
|
|
#define SHARED_RESOURCE_H
|
|
|
|
#include "core/string.h"
|
|
|
|
#include "resource.h"
|
|
#include "core/threading/rw_lock.h"
|
|
|
|
class SharedResource : public Resource {
|
|
RCPP_OBJECT(SharedResource, Resource);
|
|
|
|
public:
|
|
void read_lock();
|
|
void read_unlock();
|
|
Error read_try_lock();
|
|
|
|
void write_lock();
|
|
void write_unlock();
|
|
Error write_try_lock();
|
|
|
|
SharedResource();
|
|
~SharedResource();
|
|
|
|
private:
|
|
RWLock _lock;
|
|
};
|
|
|
|
#endif |