On Mon, Dec 09, 2013 at 05:18:30PM +0800, Robin Dong wrote: > From: Robin Dong <sanbai at taobao.com> > > Using only lock_id as parameter of lock interface and reduce function to only > two: > > lock(uint64_t lock_id) > unlock(uint64_t lock_id) > > The ->lock will create and acquire the distributed lock and ->unlock will > release it which is more convient for end user. > We use existed hash table to store the "<lock_id, cluster_lock*>" and release > all the resources of a distributed lock after all threads call "->unlock". > > v3 --> v4: > 1. move new function after zk_helpers. > 2. if znode is not exists, the zk_unlock will success. Applied after removing unnecessary forward declaration. Thanks Yuan |