-
Notifications
You must be signed in to change notification settings - Fork 54
/
aqo_shared.h
46 lines (33 loc) · 1.11 KB
/
aqo_shared.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef AQO_SHARED_H
#define AQO_SHARED_H
#include "lib/dshash.h"
#include "postmaster/bgworker.h"
#include "storage/dsm.h"
#include "storage/ipc.h"
#include "storage/lwlock.h"
#include "utils/dsa.h"
#define AQO_SHARED_MAGIC 0x053163
typedef struct AQOSharedState
{
LWLock lock; /* mutual exclusion */
/* Storage fields */
LWLock stat_lock; /* lock for access to stat storage */
bool stat_changed;
LWLock qtexts_lock; /* Lock for shared fields below */
dsa_handle qtexts_dsa_handler; /* DSA area for storing of query texts */
int qtext_trancheid;
bool qtexts_changed;
LWLock data_lock; /* Lock for shared fields below */
dsa_handle data_dsa_handler;
bool data_changed;
LWLock queries_lock; /* lock for access to queries storage */
bool queries_changed;
BackgroundWorkerHandle *bgw_handle;
} AQOSharedState;
extern shmem_startup_hook_type prev_shmem_startup_hook;
extern AQOSharedState *aqo_state;
extern int fs_max_items; /* Max number of feature spaces that AQO can operate */
extern int fss_max_items;
extern Size aqo_memsize(void);
extern void aqo_init_shmem(void);
#endif /* AQO_SHARED_H */