mirror of
				https://github.com/codership/wsrep-lib.git
				synced 2025-11-03 05:33:11 +03:00 
			
		
		
		
	Operation context pointer for client state
This commit is contained in:
		@@ -1052,6 +1052,9 @@ namespace wsrep
 | 
				
			|||||||
        {
 | 
					        {
 | 
				
			||||||
            return current_error_status_;
 | 
					            return current_error_status_;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        void set_operation_context(wsrep::operation_context* context);
 | 
				
			||||||
 | 
					        wsrep::operation_context* operation_context();
 | 
				
			||||||
    protected:
 | 
					    protected:
 | 
				
			||||||
        /**
 | 
					        /**
 | 
				
			||||||
         * Client context constuctor. This is protected so that it
 | 
					         * Client context constuctor. This is protected so that it
 | 
				
			||||||
@@ -1064,6 +1067,7 @@ namespace wsrep
 | 
				
			|||||||
                     const client_id& id,
 | 
					                     const client_id& id,
 | 
				
			||||||
                     enum mode mode)
 | 
					                     enum mode mode)
 | 
				
			||||||
            : owning_thread_id_(wsrep::this_thread::get_id())
 | 
					            : owning_thread_id_(wsrep::this_thread::get_id())
 | 
				
			||||||
 | 
					            , current_context_()
 | 
				
			||||||
            , rollbacker_active_(false)
 | 
					            , rollbacker_active_(false)
 | 
				
			||||||
            , mutex_(mutex)
 | 
					            , mutex_(mutex)
 | 
				
			||||||
            , cond_(cond)
 | 
					            , cond_(cond)
 | 
				
			||||||
@@ -1127,6 +1131,7 @@ namespace wsrep
 | 
				
			|||||||
        void leave_toi_common();
 | 
					        void leave_toi_common();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        wsrep::thread::id owning_thread_id_;
 | 
					        wsrep::thread::id owning_thread_id_;
 | 
				
			||||||
 | 
					        wsrep::operation_context* current_context_;
 | 
				
			||||||
        bool rollbacker_active_;
 | 
					        bool rollbacker_active_;
 | 
				
			||||||
        wsrep::mutex& mutex_;
 | 
					        wsrep::mutex& mutex_;
 | 
				
			||||||
        wsrep::condition_variable& cond_;
 | 
					        wsrep::condition_variable& cond_;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -767,6 +767,17 @@ int wsrep::client_state::sync_wait(int timeout)
 | 
				
			|||||||
    return ret;
 | 
					    return ret;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void wsrep::client_state::set_operation_context(
 | 
				
			||||||
 | 
					    wsrep::operation_context* context)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    current_context_ = context;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					wsrep::operation_context* wsrep::client_state::operation_context()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    return current_context_;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
///////////////////////////////////////////////////////////////////////////////
 | 
					///////////////////////////////////////////////////////////////////////////////
 | 
				
			||||||
//                               Private                                     //
 | 
					//                               Private                                     //
 | 
				
			||||||
///////////////////////////////////////////////////////////////////////////////
 | 
					///////////////////////////////////////////////////////////////////////////////
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user