You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
416 B
16 lines
416 B
#include "android-base/thread_annotations.h"
|
|
|
|
// Encapsulates advisory file lock for a given field descriptor
|
|
class CAPABILITY("FileLock") FileLock {
|
|
public:
|
|
FileLock(int fd);
|
|
~FileLock() = default;
|
|
|
|
// Acquires advisory file lock. This will block only if called from different processes.
|
|
int lock() ACQUIRE();
|
|
// Releases advisory file lock.
|
|
int unlock() RELEASE();
|
|
|
|
private:
|
|
int fd_;
|
|
}; |