HOPS
HOPS class reference
Classes | Macros | Typedefs | Functions | Variables
write_lock_mechanism.h File Reference
#include "fileset.h"

Go to the source code of this file.

Classes

struct  lockfile_data
 

Macros

#define LOCK_FILE_ERROR   -4
 
#define LOCK_FILESET_FAIL   -6
 
#define LOCK_INVALID   -1
 
#define LOCK_PARSE_ERROR   -2
 
#define LOCK_PROCESS_HAS_PRIORITY   1
 
#define LOCK_PROCESS_NO_PRIORITY   -1
 
#define LOCK_STALE_ERROR   -3
 
#define LOCK_STALE_SEC   300
 
#define LOCK_STATUS_OK   0
 
#define LOCK_TIMEOUT   9000
 
#define LOCK_TIMEOUT_ERROR   -5
 
#define LOCK_VALID   0
 
#define MAX_LOCKNAME_LEN   512
 

Typedefs

typedef struct lockfile_data lockfile_data_struct
 

Functions

int at_front (char *rootname, char *lockfile_name, int cand_seq_no)
 
int check_stale (lockfile_data_struct *other)
 
void clear_global_lockfile_data ()
 
int create_lockfile (char *rootname, char *lockfile_name, int cand_seq_no)
 
void init_lockfile_data (lockfile_data_struct *data)
 
int lock_has_priority (lockfile_data_struct *other)
 
int parse_lockfile_name (char *lockfile_name_base, lockfile_data_struct *result)
 
void remove_lockfile ()
 
int wait_for_write_lock (char *rootname, char *lockfile_name, struct fileset *fset)
 

Variables

lockfile_data_struct global_lockfile_data
 

Class Documentation

◆ lockfile_data

struct lockfile_data
Class Members
char hostname[256]
char lockfile_name[MAX_LOCKNAME_LEN]
unsigned int pid
unsigned int seq_number
unsigned long int time_sec
unsigned long int time_usec
int validity

Macro Definition Documentation

◆ LOCK_FILE_ERROR

#define LOCK_FILE_ERROR   -4

◆ LOCK_FILESET_FAIL

#define LOCK_FILESET_FAIL   -6

◆ LOCK_INVALID

#define LOCK_INVALID   -1

◆ LOCK_PARSE_ERROR

#define LOCK_PARSE_ERROR   -2

◆ LOCK_PROCESS_HAS_PRIORITY

#define LOCK_PROCESS_HAS_PRIORITY   1

◆ LOCK_PROCESS_NO_PRIORITY

#define LOCK_PROCESS_NO_PRIORITY   -1

◆ LOCK_STALE_ERROR

#define LOCK_STALE_ERROR   -3

◆ LOCK_STALE_SEC

#define LOCK_STALE_SEC   300

◆ LOCK_STATUS_OK

#define LOCK_STATUS_OK   0

◆ LOCK_TIMEOUT

#define LOCK_TIMEOUT   9000

◆ LOCK_TIMEOUT_ERROR

#define LOCK_TIMEOUT_ERROR   -5

◆ LOCK_VALID

#define LOCK_VALID   0

◆ MAX_LOCKNAME_LEN

#define MAX_LOCKNAME_LEN   512

Typedef Documentation

◆ lockfile_data_struct

Function Documentation

◆ at_front()

int at_front ( char *  rootname,
char *  lockfile_name,
int  cand_seq_no 
)

◆ check_stale()

int check_stale ( lockfile_data_struct other)

◆ clear_global_lockfile_data()

void clear_global_lockfile_data ( )

◆ create_lockfile()

int create_lockfile ( char *  rootname,
char *  lockfile_name,
int  cand_seq_no 
)

◆ init_lockfile_data()

void init_lockfile_data ( lockfile_data_struct data)

◆ lock_has_priority()

int lock_has_priority ( lockfile_data_struct other)

◆ parse_lockfile_name()

int parse_lockfile_name ( char *  lockfile_name_base,
lockfile_data_struct result 
)

◆ remove_lockfile()

void remove_lockfile ( )

◆ wait_for_write_lock()

int wait_for_write_lock ( char *  rootname,
char *  lockfile_name,
struct fileset fset 
)

Variable Documentation

◆ global_lockfile_data

lockfile_data_struct global_lockfile_data
extern