parcel | Lucy |
class variable | LUCY_LOCKFACTORY |
struct symbol | lucy_LockFactory |
class nickname | lucy_LockFact |
header file | Lucy/Store/LockFactory.h |
Lucy::Store::LockFactory – Create Locks.
LockFactory is used to spin off interprocess mutex locks used by various index reading and writing components. The default implementation uses lockfiles, but LockFactory subclasses which are implemented using alternatives such as flock() are possible.
lucy_LockFactory* // incremented
lucy_LockFact_new(
lucy_Folder *folder,
cfish_String *host
);
Create a new LockFactory.
A Folder.
An identifier which should be unique per-machine.
lucy_LockFactory*
lucy_LockFact_init(
lucy_LockFactory *self,
lucy_Folder *folder,
cfish_String *host
);
Initialize a LockFactory.
A Folder.
An identifier which should be unique per-machine.
lucy_Lock* // incremented
lucy_LockFact_Make_Lock(
lucy_LockFactory *self,
cfish_String *name,
int32_t timeout,
int32_t interval
);
Return a Lock object, which, once Obtain() returns successfully, maintains an exclusive lock on a resource.
A file-system-friendly id which identifies the resource to be locked.
Time in milliseconds to keep retrying before abandoning the attempt to Obtain() a lock.
Time in milliseconds between retries.
lucy_Lock* // incremented
lucy_LockFact_Make_Shared_Lock(
lucy_LockFactory *self,
cfish_String *name,
int32_t timeout,
int32_t interval
);
Return a Lock object for which Shared() returns true, and which maintains a non-exclusive lock on a resource once Obtain() returns success.
A file-system-friendly id which identifies the resource to be locked.
Time in milliseconds to keep retrying before abandoning the attempt to Obtain() a lock.
Time in milliseconds between retries.
Lucy::Store::LockFactory is a Clownfish::Obj.
Copyright © 2010-2015 The Apache Software Foundation, Licensed under the
Apache License, Version 2.0.
Apache Lucy, Lucy, Apache, the Apache feather logo, and the Apache Lucy project logo are trademarks of The
Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their
respective owners.