File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 45
45
#include "port/atomics.h"
46
46
#include "pgstat.h"
47
47
#include "portability/mem.h"
48
+ #include "postmaster/bgworker.h"
49
+ #include "postmaster/postmaster.h"
48
50
#include "storage/fd.h"
49
51
#include "storage/cfs.h"
50
52
#include "storage/ipc.h"
53
55
#include "utils/rel.h"
54
56
#include "utils/builtins.h"
55
57
#include "utils/resowner_private.h"
56
- #include "postmaster/bgworker.h"
57
58
58
59
59
60
/*
@@ -398,6 +399,12 @@ int cfs_shmem_size()
398
399
void cfs_initialize ()
399
400
{
400
401
bool found ;
402
+
403
+ StaticAssertStmt ((CFS_GC_LOCK & (CFS_GC_LOCK - 1 )) == 0 ,
404
+ "CFS_GC_LOCK should be single bit" );
405
+ StaticAssertStmt (CFS_GC_LOCK > MAX_BACKENDS ,
406
+ "CFS_GC_LOCK should be larger than MAX_BACKENDS" );
407
+
401
408
cfs_state = (CfsState * )ShmemInitStruct ("CFS Control" ,
402
409
sizeof (CfsState ) + sizeof (pg_atomic_uint32 )* MaxBackends , & found );
403
410
if (!found )
Original file line number Diff line number Diff line change 8
8
9
9
#define CFS_VERSION "0.45"
10
10
11
- #define CFS_GC_LOCK 0x10000000
11
+ #define CFS_GC_LOCK (MAX_BACKENDS+1)
12
12
13
13
#define CFS_LOCK_MIN_TIMEOUT 100 /* microseconds: initial timeout of GC lock acquisition */
14
14
#define CFS_LOCK_MAX_TIMEOUT 10000 /* microseconds */
You can’t perform that action at this time.
0 commit comments