@@ -954,45 +954,31 @@ WaitForBackgroundWorkerStartup(BackgroundWorkerHandle *handle, pid_t *pidp)
954
954
{
955
955
BgwHandleStatus status ;
956
956
int rc ;
957
- bool save_set_latch_on_sigusr1 ;
958
957
959
- save_set_latch_on_sigusr1 = set_latch_on_sigusr1 ;
960
- set_latch_on_sigusr1 = true;
961
-
962
- PG_TRY ();
958
+ for (;;)
963
959
{
964
- for (;;)
965
- {
966
- pid_t pid ;
960
+ pid_t pid ;
967
961
968
- CHECK_FOR_INTERRUPTS ();
962
+ CHECK_FOR_INTERRUPTS ();
969
963
970
- status = GetBackgroundWorkerPid (handle , & pid );
971
- if (status == BGWH_STARTED )
972
- * pidp = pid ;
973
- if (status != BGWH_NOT_YET_STARTED )
974
- break ;
975
-
976
- rc = WaitLatch (MyLatch ,
977
- WL_LATCH_SET | WL_POSTMASTER_DEATH , 0 );
964
+ status = GetBackgroundWorkerPid (handle , & pid );
965
+ if (status == BGWH_STARTED )
966
+ * pidp = pid ;
967
+ if (status != BGWH_NOT_YET_STARTED )
968
+ break ;
978
969
979
- if (rc & WL_POSTMASTER_DEATH )
980
- {
981
- status = BGWH_POSTMASTER_DIED ;
982
- break ;
983
- }
970
+ rc = WaitLatch (MyLatch ,
971
+ WL_LATCH_SET | WL_POSTMASTER_DEATH , 0 );
984
972
985
- ResetLatch (MyLatch );
973
+ if (rc & WL_POSTMASTER_DEATH )
974
+ {
975
+ status = BGWH_POSTMASTER_DIED ;
976
+ break ;
986
977
}
978
+
979
+ ResetLatch (MyLatch );
987
980
}
988
- PG_CATCH ();
989
- {
990
- set_latch_on_sigusr1 = save_set_latch_on_sigusr1 ;
991
- PG_RE_THROW ();
992
- }
993
- PG_END_TRY ();
994
981
995
- set_latch_on_sigusr1 = save_set_latch_on_sigusr1 ;
996
982
return status ;
997
983
}
998
984
@@ -1009,40 +995,26 @@ WaitForBackgroundWorkerShutdown(BackgroundWorkerHandle *handle)
1009
995
{
1010
996
BgwHandleStatus status ;
1011
997
int rc ;
1012
- bool save_set_latch_on_sigusr1 ;
1013
-
1014
- save_set_latch_on_sigusr1 = set_latch_on_sigusr1 ;
1015
- set_latch_on_sigusr1 = true;
1016
998
1017
- PG_TRY ();
999
+ for (;;)
1018
1000
{
1019
- for (;;)
1020
- {
1021
- pid_t pid ;
1001
+ pid_t pid ;
1022
1002
1023
- CHECK_FOR_INTERRUPTS ();
1003
+ CHECK_FOR_INTERRUPTS ();
1024
1004
1025
- status = GetBackgroundWorkerPid (handle , & pid );
1026
- if (status == BGWH_STOPPED )
1027
- return status ;
1005
+ status = GetBackgroundWorkerPid (handle , & pid );
1006
+ if (status == BGWH_STOPPED )
1007
+ return status ;
1028
1008
1029
- rc = WaitLatch (& MyProc -> procLatch ,
1030
- WL_LATCH_SET | WL_POSTMASTER_DEATH , 0 );
1009
+ rc = WaitLatch (& MyProc -> procLatch ,
1010
+ WL_LATCH_SET | WL_POSTMASTER_DEATH , 0 );
1031
1011
1032
- if (rc & WL_POSTMASTER_DEATH )
1033
- return BGWH_POSTMASTER_DIED ;
1012
+ if (rc & WL_POSTMASTER_DEATH )
1013
+ return BGWH_POSTMASTER_DIED ;
1034
1014
1035
- ResetLatch (& MyProc -> procLatch );
1036
- }
1037
- }
1038
- PG_CATCH ();
1039
- {
1040
- set_latch_on_sigusr1 = save_set_latch_on_sigusr1 ;
1041
- PG_RE_THROW ();
1015
+ ResetLatch (& MyProc -> procLatch );
1042
1016
}
1043
- PG_END_TRY ();
1044
1017
1045
- set_latch_on_sigusr1 = save_set_latch_on_sigusr1 ;
1046
1018
return status ;
1047
1019
}
1048
1020
0 commit comments