◆ NativeFileLock()
| Slic3r::NativeFileLock::NativeFileLock |
( |
const char * | path | ) |
|
|
inlineexplicit |
39 :
m_fd(::open(path, O_RDWR | O_CREAT | O_CLOEXEC, 0644))
40 {
42 throw std::system_error(errno, std::generic_category(), path);
43 }
int m_fd
Definition InstanceLock.cpp:56
References m_fd.
◆ ~NativeFileLock()
| Slic3r::NativeFileLock::~NativeFileLock |
( |
| ) |
|
|
inline |
◆ try_lock()
| bool Slic3r::NativeFileLock::try_lock |
( |
| ) |
|
|
inline |
46 {
47 if (::flock(
m_fd, LOCK_EX | LOCK_NB) == 0)
48 return true;
49
50 if (errno == EWOULDBLOCK || errno == EINTR)
51 return false;
52 throw std::system_error(errno, std::generic_category(), "flock");
53 }
References m_fd.
◆ unlock()
| void Slic3r::NativeFileLock::unlock |
( |
| ) |
|
|
inline |
54{ ::flock(
m_fd, LOCK_UN); }
References m_fd.
◆ m_fd
| int Slic3r::NativeFileLock::m_fd |
|
private |
The documentation for this class was generated from the following file: