2016-02-17 06:32:03 +03:00
/*
CTDB cluster mutex handling
Copyright ( C ) Andrew Tridgell 2007
Copyright ( C ) Ronnie Sahlberg 2007
Copyright ( C ) Martin Schwenke 2016
This program is free software ; you can redistribute it and / or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 3 of the License , or
( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
You should have received a copy of the GNU General Public License
along with this program ; if not , see < http : //www.gnu.org/licenses/>.
*/
# ifndef __CTDB_CLUSTER_MUTEX_H__
# define __CTDB_CLUSTER_MUTEX_H__
2016-05-29 12:27:23 +03:00
# include <talloc.h>
2016-02-17 06:32:03 +03:00
# include "replace.h"
# include "system/network.h"
# include "ctdb_private.h"
struct ctdb_cluster_mutex_handle ;
typedef void ( * cluster_mutex_handler_t ) (
char status ,
double latency ,
void * private_data ) ;
2016-06-01 12:05:47 +03:00
typedef void ( * cluster_mutex_lost_handler_t ) ( void * private_data ) ;
2016-02-17 06:32:03 +03:00
struct ctdb_cluster_mutex_handle *
2016-05-29 12:27:23 +03:00
ctdb_cluster_mutex ( TALLOC_CTX * mem_ctx ,
struct ctdb_context * ctdb ,
2016-02-17 06:32:03 +03:00
const char * argstring ,
2016-06-01 11:56:33 +03:00
int timeout ,
cluster_mutex_handler_t handler ,
2016-06-01 12:05:47 +03:00
void * private_data ,
cluster_mutex_lost_handler_t lost_handler ,
void * lost_data ) ;
2016-02-17 06:32:03 +03:00
2016-06-06 08:04:08 +03:00
# endif /* __CTDB_CLUSTER_MUTEX_H__ */