Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef RESOWNER_H
00020 #define RESOWNER_H
00021
00022
00023
00024
00025
00026
00027 typedef struct ResourceOwnerData *ResourceOwner;
00028
00029
00030
00031
00032
00033 extern PGDLLIMPORT ResourceOwner CurrentResourceOwner;
00034 extern PGDLLIMPORT ResourceOwner CurTransactionResourceOwner;
00035 extern PGDLLIMPORT ResourceOwner TopTransactionResourceOwner;
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 typedef enum
00046 {
00047 RESOURCE_RELEASE_BEFORE_LOCKS,
00048 RESOURCE_RELEASE_LOCKS,
00049 RESOURCE_RELEASE_AFTER_LOCKS
00050 } ResourceReleasePhase;
00051
00052
00053
00054
00055
00056 typedef void (*ResourceReleaseCallback) (ResourceReleasePhase phase,
00057 bool isCommit,
00058 bool isTopLevel,
00059 void *arg);
00060
00061
00062
00063
00064
00065
00066
00067 extern ResourceOwner ResourceOwnerCreate(ResourceOwner parent,
00068 const char *name);
00069 extern void ResourceOwnerRelease(ResourceOwner owner,
00070 ResourceReleasePhase phase,
00071 bool isCommit,
00072 bool isTopLevel);
00073 extern void ResourceOwnerDelete(ResourceOwner owner);
00074 extern ResourceOwner ResourceOwnerGetParent(ResourceOwner owner);
00075 extern void ResourceOwnerNewParent(ResourceOwner owner,
00076 ResourceOwner newparent);
00077 extern void RegisterResourceReleaseCallback(ResourceReleaseCallback callback,
00078 void *arg);
00079 extern void UnregisterResourceReleaseCallback(ResourceReleaseCallback callback,
00080 void *arg);
00081
00082 #endif