MCPcopy Create free account
hub / github.com/apache/incubator-pegasus / remove_my_locknode

Method remove_my_locknode

src/zookeeper/lock_struct.cpp:730–756  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

728}
729
730void lock_struct::remove_my_locknode(std::string &&znode_path,
731 bool ignore_callback,
732 bool remove_for_unlock)
733{
734 lock_struct_ptr _this = this;
735 auto result_wrapper =
736 [_this, ignore_callback, remove_for_unlock](zookeeper_session::zoo_opcontext *op) {
737 LOG_INFO("delete node {}, result({})", op->_input._path, zerror(op->_output.error));
738 if (is_zookeeper_timeout(op->_output.error)) {
739 __add_ref_and_delay_call(op, _this);
740 return;
741 }
742
743 if (IGNORE_CALLBACK != ignore_callback) {
744 __execute(std::bind(&lock_struct::after_remove_my_locknode,
745 _this,
746 op->_output.error,
747 remove_for_unlock),
748 _this);
749 }
750 };
751 zookeeper_session::zoo_opcontext *op = zookeeper_session::create_context();
752 op->_optype = zookeeper_session::ZOO_DELETE;
753 op->_input._path = std::move(znode_path);
754 op->_callback_function = result_wrapper;
755 _dist_lock_service->session()->visit(op);
756}
757
758/*static*/
759void lock_struct::cancel_pending_lock(lock_struct_ptr _this, lock_future_ptr cancel_callback)

Callers 3

after_create_locknodeMethod · 0.80
cancel_pending_lockMethod · 0.80
unlockMethod · 0.80

Calls 3

is_zookeeper_timeoutFunction · 0.85
visitMethod · 0.80
sessionMethod · 0.80

Tested by

no test coverage detected