|
🛰️航天仿真算法库 SpaceAST 0.3.1
|
#include "FileLock.hpp"#include "AstUtil/FileSystem.hpp"#include "AstUtil/Logger.hpp"#include <chrono>#include <cstdio>#include <ctime>#include <string>#include <system_error>#include <utility>#include <cerrno>#include <cstring>#include <fcntl.h>#include <sys/file.h>#include <time.h>#include <unistd.h>类 | |
| class | ast::FileLock::Impl |
命名空间 | |
| namespace | ast |
宏定义 | |
| #define | O_CLOEXEC 0 |
类型定义 | |
| using | ast::ELockMode = FileLock::ELockMode |
| using | ast::ELockResult = FileLock::ELockResult |
跨进程文件锁实现
Windows 使用 LockFileEx 锁定锁文件的一段字节,POSIX 使用 flock, WebAssembly 不支持跨进程加锁。
ast项目(https://github.com/space-ast/ast) 本项目基于 Apache 2.0 开源许可证分发。 您可在遵守许可证条款的前提下使用、修改和分发本软件。 许可证全文请见:
http://www.apache.org/licenses/LICENSE-2.0
重要须知: 软件按“现有状态”提供,无任何明示或暗示的担保条件。 除非法律要求或书面同意,作者与贡献者不承担任何责任。 使用本软件所产生的风险,需由您自行承担。