*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.12 1997/01/24 23:48:25 scrappy Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.13 1997/03/10 00:18:09 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
#include <port-protos.h> /* for strdup() */
+#include <storage/lmgr.h>
+
static int notifyFrontEndPending = 0;
static int notifyIssued = 0;
static Dllist *pendingNotifies = NULL;
lRel = heap_openr(ListenerRelationName);
tdesc = RelationGetTupleDescriptor(lRel);
+ RelationSetLockForWrite(lRel);
sRel = heap_beginscan(lRel, 0, NowTimeQual, 1, &key);
nulls[0] = nulls[1] = nulls[2] = ' ';
ReleaseBuffer(b);
}
heap_endscan(sRel);
+ RelationUnsetLockForWrite(lRel);
heap_close(lRel);
notifyIssued = 1;
}
Integer32EqualRegProcedure,
Int32GetDatum(1));
lRel = heap_openr(ListenerRelationName);
+ RelationSetLockForWrite(lRel);
sRel = heap_beginscan(lRel, 0, NowTimeQual, 1, &key);
tdesc = RelationGetTupleDescriptor(lRel);
ourpid = getpid();
ReleaseBuffer(b);
}
heap_endscan(sRel);
+ RelationUnsetLockForWrite(lRel);
heap_close(lRel);
CommitTransactionCommand();
values[i++] = (Datum) 0; /* no notifies pending */
lDesc = heap_openr(ListenerRelationName);
+ RelationSetLockForWrite(lDesc);
/* is someone already listening. One listener per relation */
tdesc = RelationGetTupleDescriptor(lDesc);
/* if (alreadyListener) {
elog(NOTICE,"Async_Listen: already one listener on %s (possibly dead)",relname);
}*/
+
+ RelationUnsetLockForWrite(lDesc);
heap_close(lDesc);
/*
Int32GetDatum(pid),
0,0);
lDesc = heap_openr(ListenerRelationName);
+ RelationSetLockForWrite(lDesc);
+
if (lTuple != NULL) {
heap_delete(lDesc,&lTuple->t_ctid);
}
+
+ RelationUnsetLockForWrite(lDesc);
heap_close(lDesc);
}
Integer32EqualRegProcedure,
Int32GetDatum(ourpid));
lRel = heap_openr(ListenerRelationName);
+ RelationSetLockForWrite(lRel);
tdesc = RelationGetTupleDescriptor(lRel);
sRel = heap_beginscan(lRel, 0, NowTimeQual, 2, key);