blob: 78eea1eae01c5cae63f02aa77d0c0f84c4f4a493 (
plain)
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
|
*** src/backend/commands/async.c.orig Sun Sep 15 21:24:41 2002
--- src/backend/commands/async.c Mon Feb 17 21:38:47 2003
***************
*** 599,604 ****
--- 599,614 ----
if (notifyInterruptEnabled)
{
+ bool save_ImmediateInterruptOK = ImmediateInterruptOK;
+
+ /*
+ * We may be called while ImmediateInterruptOK is true; turn it off
+ * while messing with the NOTIFY state. (We would have to save
+ * and restore it anyway, because PGSemaphore operations inside
+ * ProcessIncomingNotify() might reset it.)
+ */
+ ImmediateInterruptOK = false;
+
/*
* I'm not sure whether some flavors of Unix might allow another
* SIGUSR2 occurrence to recursively interrupt this routine. To
***************
*** 626,631 ****
--- 636,648 ----
elog(LOG, "Async_NotifyHandler: done");
}
}
+
+ /*
+ * Restore ImmediateInterruptOK, and check for interrupts if needed.
+ */
+ ImmediateInterruptOK = save_ImmediateInterruptOK;
+ if (save_ImmediateInterruptOK)
+ CHECK_FOR_INTERRUPTS();
}
else
{
|