File tree 1 file changed +9
-12
lines changed
1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -1481,20 +1481,17 @@ void cfs_gc_start_bgworkers()
1481
1481
void cfs_control_gc_lock (void )
1482
1482
{
1483
1483
uint32 was_disabled = pg_atomic_fetch_add_u32 (& cfs_state -> gc_disabled , 1 );
1484
- if (!was_disabled )
1484
+ /* Wait until there are no active GC workers */
1485
+ while (pg_atomic_read_u32 (& cfs_state -> n_active_gc ) != 0 )
1485
1486
{
1486
- /* Wait until there are no active GC workers */
1487
- while (pg_atomic_read_u32 (& cfs_state -> n_active_gc ) != 0 )
1488
- {
1489
- int rc = WaitLatch (MyLatch ,
1490
- WL_LATCH_SET | WL_TIMEOUT | WL_POSTMASTER_DEATH ,
1491
- CFS_DISABLE_TIMEOUT /* ms */ );
1492
- if (rc & WL_POSTMASTER_DEATH )
1493
- exit (1 );
1487
+ int rc = WaitLatch (MyLatch ,
1488
+ WL_LATCH_SET | WL_TIMEOUT | WL_POSTMASTER_DEATH ,
1489
+ CFS_DISABLE_TIMEOUT /* ms */ );
1490
+ if (rc & WL_POSTMASTER_DEATH )
1491
+ exit (1 );
1494
1492
1495
- ResetLatch (MyLatch );
1496
- CHECK_FOR_INTERRUPTS ();
1497
- }
1493
+ ResetLatch (MyLatch );
1494
+ CHECK_FOR_INTERRUPTS ();
1498
1495
}
1499
1496
}
1500
1497
You can’t perform that action at this time.
0 commit comments