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 #ifndef IPC_H
00019 #define IPC_H
00020
00021 typedef void (*pg_on_exit_callback) (int code, Datum arg);
00022 typedef void (*shmem_startup_hook_type) (void);
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 #define PG_ENSURE_ERROR_CLEANUP(cleanup_function, arg) \
00048 do { \
00049 on_shmem_exit(cleanup_function, arg); \
00050 PG_TRY()
00051
00052 #define PG_END_ENSURE_ERROR_CLEANUP(cleanup_function, arg) \
00053 cancel_shmem_exit(cleanup_function, arg); \
00054 PG_CATCH(); \
00055 { \
00056 cancel_shmem_exit(cleanup_function, arg); \
00057 cleanup_function (0, arg); \
00058 PG_RE_THROW(); \
00059 } \
00060 PG_END_TRY(); \
00061 } while (0)
00062
00063
00064
00065 extern bool proc_exit_inprogress;
00066
00067 extern void proc_exit(int code) __attribute__((noreturn));
00068 extern void shmem_exit(int code);
00069 extern void on_proc_exit(pg_on_exit_callback function, Datum arg);
00070 extern void on_shmem_exit(pg_on_exit_callback function, Datum arg);
00071 extern void cancel_shmem_exit(pg_on_exit_callback function, Datum arg);
00072 extern void on_exit_reset(void);
00073
00074
00075 extern PGDLLIMPORT shmem_startup_hook_type shmem_startup_hook;
00076
00077 extern void CreateSharedMemoryAndSemaphores(bool makePrivate, int port);
00078
00079 #endif