RSS

(root)/fsp/fsplib : /lock.h (revision 61)

Line Revision Contents
1 16 #ifndef _FSPLIB_H_LOCK
2 #define _FSPLIB_H_LOCK 1
3
4 15 #ifndef FSP_NOLOCKING
5 /* define locking prefix if needed */
6 # ifndef FSP_KEY_PREFIX
7 #  define FSP_KEY_PREFIX "/tmp/.FSPL"
8 # endif
9 #endif
10
11 #ifdef FSP_USE_SHAREMEM_AND_SEMOP
12
13 typedef struct FSP_LOCK {
14                 unsigned int *share_key;
15                 int   lock_shm;
16                 int   lock_sem;
17                 char key_string[sizeof(FSP_KEY_PREFIX)+32];
18 } FSP_LOCK;
19
20 #elif defined(FSP_NOLOCKING)
21
22 typedef struct FSP_LOCK {
23                unsigned short share_key;
24 } FSP_LOCK;
25
26 #elif defined(FSP_USE_LOCKF)
27
28 typedef struct FSP_LOCK {  
29                int lock_fd;
30                char key_string[sizeof(FSP_KEY_PREFIX)+32];
31 } FSP_LOCK;
32
33 #else
34 #error "No locking type specified"
35 #endif
36
37 /* prototypes */
38
39 unsigned short client_get_key (FSP_LOCK *lock);
40 void client_set_key (FSP_LOCK *lock,unsigned short key);
41 int client_init_key (FSP_LOCK *lock,
42                             unsigned long server_addr,
43                             unsigned short server_port);
44 void client_destroy_key(FSP_LOCK *lock);
45 16 #endif

Loggerhead is a web-based interface for Bazaar branches