mars/kernel/lamport.h
2017-04-15 18:10:45 +02:00

43 lines
1.5 KiB
C

/*
* MARS Long Distance Replication Software
*
* This file is part of MARS project: http://schoebel.github.io/mars/
*
* Copyright (C) 2010-2014 Thomas Schoebel-Theuer
* Copyright (C) 2011-2014 1&1 Internet AG
*
* 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 2 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, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef LAMPORT_H
#define LAMPORT_H
#include <linux/time.h>
/*
* We always get both the local real time and the Lamport time in parallel,
* consistently.
*
* The implementation ensures that the distributed Lamport timestamp can
* never fall behind the local real time.
*
* When not interested in real time, you can simply leave real_now at NULL.
*/
extern void get_lamport(struct timespec *real_now, struct timespec *lamport_now);
extern void set_lamport(struct timespec *lamport_old);
extern void set_get_lamport(struct timespec *lamport_old, struct timespec *real_now, struct timespec *lamport_now);
#endif