7
7
*
8
8
*
9
9
* IDENTIFICATION
10
- * $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.8 1996/12/07 04:36:38 momjian Exp $
10
+ * $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.9 1996/12/19 04:54:56 scrappy Exp $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
@@ -117,13 +117,17 @@ Async_NotifyHandler(SIGNAL_ARGS)
117
117
if ((CurrentTransactionState -> state == TRANS_DEFAULT ) &&
118
118
(CurrentTransactionState -> blockState == TRANS_DEFAULT )) {
119
119
120
+ #ifdef ASYNC_DEBUG
120
121
elog (DEBUG , "Waking up sleeping backend process" );
122
+ #endif
121
123
Async_NotifyFrontEnd ();
122
124
123
125
}else {
126
+ #ifdef ASYNC_DEBUG
124
127
elog (DEBUG , "Process is in the middle of another transaction, state = %d, block state = %d" ,
125
128
CurrentTransactionState -> state ,
126
129
CurrentTransactionState -> blockState );
130
+ #endif
127
131
notifyFrontEndPending = 1 ;
128
132
}
129
133
}
@@ -167,7 +171,9 @@ Async_Notify(char *relname)
167
171
168
172
char * notifyName ;
169
173
174
+ #ifdef ASYNC_DEBUG
170
175
elog (DEBUG ,"Async_Notify: %s" ,relname );
176
+ #endif
171
177
172
178
if (!pendingNotifies )
173
179
pendingNotifies = DLNewList ();
@@ -249,7 +255,9 @@ Async_NotifyAtCommit()
249
255
if (notifyIssued ) { /* 'notify <relname>' issued by us */
250
256
notifyIssued = 0 ;
251
257
StartTransactionCommand ();
258
+ #ifdef ASYNC_DEBUG
252
259
elog (DEBUG , "Async_NotifyAtCommit." );
260
+ #endif
253
261
ScanKeyEntryInitialize (& key , 0 ,
254
262
Anum_pg_listener_notify ,
255
263
Integer32EqualRegProcedure ,
@@ -268,10 +276,14 @@ Async_NotifyAtCommit()
268
276
tdesc , & isnull );
269
277
270
278
if (ourpid == DatumGetInt32 (d )) {
279
+ #ifdef ASYNC_DEBUG
271
280
elog (DEBUG , "Notifying self, setting notifyFronEndPending to 1" );
281
+ #endif
272
282
notifyFrontEndPending = 1 ;
273
283
} else {
284
+ #ifdef ASYNC_DEBUG
274
285
elog (DEBUG , "Notifying others" );
286
+ #endif
275
287
#ifndef win32
276
288
if (kill (DatumGetInt32 (d ), SIGUSR2 ) < 0 ) {
277
289
if (errno == ESRCH ) {
@@ -373,7 +385,9 @@ Async_Listen(char *relname, int pid)
373
385
char * relnamei ;
374
386
TupleDesc tupDesc ;
375
387
388
+ #ifdef ASYNC_DEBUG
376
389
elog (DEBUG ,"Async_Listen: %s" ,relname );
390
+ #endif
377
391
for (i = 0 ; i < Natts_pg_listener ; i ++ ) {
378
392
nulls [i ] = ' ' ;
379
393
values [i ] = PointerGetDatum (NULL );
@@ -514,7 +528,9 @@ Async_NotifyFrontEnd()
514
528
515
529
notifyFrontEndPending = 0 ;
516
530
531
+ #ifdef ASYNC_DEBUG
517
532
elog (DEBUG , "Async_NotifyFrontEnd: notifying front end." );
533
+ #endif
518
534
519
535
StartTransactionCommand ();
520
536
ourpid = getpid ();
0 commit comments