aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/async.c
diff options
context:
space:
mode:
authorMarc G. Fournier <scrappy@hub.org>1996-12-19 04:54:56 +0000
committerMarc G. Fournier <scrappy@hub.org>1996-12-19 04:54:56 +0000
commitf0bcb1762d2465e0e091c7c3e5507ebcbe035108 (patch)
treee8b2b487c9869d31fd8d844bc09f8d131609d2af /src/backend/commands/async.c
parentdb7a90f1d9cd8dfa148fb3524ec0c1e902511c9e (diff)
downloadpostgresql-f0bcb1762d2465e0e091c7c3e5507ebcbe035108.tar.gz
postgresql-f0bcb1762d2465e0e091c7c3e5507ebcbe035108.zip
#ifdef ASYNC_DEBUG various sections of async.c
Submitted by: Massimo Dal Zotto <dz@cs.unitn.it>
Diffstat (limited to 'src/backend/commands/async.c')
-rw-r--r--src/backend/commands/async.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/backend/commands/async.c b/src/backend/commands/async.c
index 49f099c970a..4f4739836a1 100644
--- a/src/backend/commands/async.c
+++ b/src/backend/commands/async.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.8 1996/12/07 04:36:38 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.9 1996/12/19 04:54:56 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@@ -117,13 +117,17 @@ Async_NotifyHandler(SIGNAL_ARGS)
if ((CurrentTransactionState->state == TRANS_DEFAULT) &&
(CurrentTransactionState->blockState == TRANS_DEFAULT)) {
+#ifdef ASYNC_DEBUG
elog(DEBUG, "Waking up sleeping backend process");
+#endif
Async_NotifyFrontEnd();
}else {
+#ifdef ASYNC_DEBUG
elog(DEBUG, "Process is in the middle of another transaction, state = %d, block state = %d",
CurrentTransactionState->state,
CurrentTransactionState->blockState);
+#endif
notifyFrontEndPending = 1;
}
}
@@ -167,7 +171,9 @@ Async_Notify(char *relname)
char *notifyName;
+#ifdef ASYNC_DEBUG
elog(DEBUG,"Async_Notify: %s",relname);
+#endif
if (!pendingNotifies)
pendingNotifies = DLNewList();
@@ -249,7 +255,9 @@ Async_NotifyAtCommit()
if (notifyIssued) { /* 'notify <relname>' issued by us */
notifyIssued = 0;
StartTransactionCommand();
+#ifdef ASYNC_DEBUG
elog(DEBUG, "Async_NotifyAtCommit.");
+#endif
ScanKeyEntryInitialize(&key, 0,
Anum_pg_listener_notify,
Integer32EqualRegProcedure,
@@ -268,10 +276,14 @@ Async_NotifyAtCommit()
tdesc, &isnull);
if (ourpid == DatumGetInt32(d)) {
+#ifdef ASYNC_DEBUG
elog(DEBUG, "Notifying self, setting notifyFronEndPending to 1");
+#endif
notifyFrontEndPending = 1;
} else {
+#ifdef ASYNC_DEBUG
elog(DEBUG, "Notifying others");
+#endif
#ifndef win32
if (kill(DatumGetInt32(d), SIGUSR2) < 0) {
if (errno == ESRCH) {
@@ -373,7 +385,9 @@ Async_Listen(char *relname, int pid)
char *relnamei;
TupleDesc tupDesc;
+#ifdef ASYNC_DEBUG
elog(DEBUG,"Async_Listen: %s",relname);
+#endif
for (i = 0 ; i < Natts_pg_listener; i++) {
nulls[i] = ' ';
values[i] = PointerGetDatum(NULL);
@@ -514,7 +528,9 @@ Async_NotifyFrontEnd()
notifyFrontEndPending = 0;
+#ifdef ASYNC_DEBUG
elog(DEBUG, "Async_NotifyFrontEnd: notifying front end.");
+#endif
StartTransactionCommand();
ourpid = getpid();