00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef LOCK_H
00021 #define LOCK_H
00022
00023 #include <common/main.h>
00024
00025 struct string_ty;
00026
00027 typedef void (*lock_callback_ty)(void *);
00028
00029 void lock_prepare_gstate(lock_callback_ty, void *);
00030 void lock_prepare_pstate(struct string_ty *project_name,
00031 lock_callback_ty, void *);
00032 void lock_prepare_ustate(int uid, lock_callback_ty, void *);
00033 void lock_prepare_ustate_all(lock_callback_ty, void *);
00034 void lock_prepare_cstate(struct string_ty *project_name, long change_number,
00035 lock_callback_ty, void *);
00036 void lock_take(void);
00037 void lock_release(void);
00038 long lock_magic(void);
00039 void lock_prepare_baseline_read(struct string_ty *project_name,
00040 lock_callback_ty, void *);
00041 void lock_prepare_baseline_write(struct string_ty *project_name,
00042 lock_callback_ty, void *);
00043 void lock_prepare_history(struct string_ty *project_name, lock_callback_ty,
00044 void *);
00045
00046 enum lock_walk_name
00047 {
00048 lock_walk_name_master,
00049 lock_walk_name_gstate,
00050 lock_walk_name_pstate,
00051 lock_walk_name_cstate,
00052 lock_walk_name_baseline,
00053 lock_walk_name_baseline_priority,
00054 lock_walk_name_history,
00055 lock_walk_name_ustate,
00056 lock_walk_name_unknown
00057 };
00058
00059 enum lock_walk_type
00060 {
00061 lock_walk_type_shared,
00062 lock_walk_type_exclusive,
00063 lock_walk_type_unknown
00064 };
00065
00066 struct lock_walk_found
00067 {
00068 lock_walk_name name;
00069 lock_walk_type type;
00070 long subset;
00071 long address;
00072 int pid;
00073 int pid_is_local;
00074 };
00075
00076 typedef void (*lock_walk_callback)(lock_walk_found *);
00077
00078 void lock_walk(lock_walk_callback);
00079 void lock_release_child(void);
00080
00085 void lock_quitter(void);
00086
00095 bool lock_active(void);
00096
00097
00098 #endif // LOCK_H