Google
 

Trailing-Edge - PDP-10 Archives - bb-bt99e-bb - queser.c09
There is 1 other file named queser.c09 in the archive. Click here to see a list.
 REP 20/24	;09C1
		PUSH	P,T1		;SAVE LOCK BLOCK ADDR
		PUSHJ	P,COUNTQ	;COUNT THE QUEUE LENGTH
		HRL	P2,T2		;PUT IT IN LEFT HALF
		POP	P,T1		;RESTORE LOCK-BLOCK ADDR
 WIT
		PUSHJ	P,COUNTQ	;COUNT THE QUEUE LENGTH
		JUMPE	T2,[MOVEI P3,-1	;NO ONE IN QUEUE, SET STATUS=-1
			    SETZB P4,P2	;CLEAR TIME-STAMP
			    JRST TELHIM]
		HRLZ	P2,T2		;PUT IT IN LEFT HALF
 REP 27/24	;09C2
		LOAD.	T1,.LBNQ,(T3)	;GET FIRST Q-BLOCK IN QUEUE (T3=LOCK)
		LOAD.	P2,.QBRID,(T1)	;REQUEST ID
 WIT
		LOAD.	T1,.LBNQ,(T1)	;GET FIRST Q-BLOCK IN QUEUE (T1=LOCK)
		LOAD.	T2,.QBRID,(T1)	;REQUEST ID
		HRR	P2,T2		;PUT IT IN RIGHT HALF
 REP 4/25	;09C3
		LOAD.	T2,.QBFLG,(T1)	;GET HIS FLAG'S
		LOAD.	P2,.QBRID,(T1)	;GET REQUEST ID.
 WIT
		LOAD.	T2,.QBRID,(T1)	;GET REQUEST ID.
		HRR	P2,T2		;PUT IT IN RIGHT HALF
		LOAD.	T2,.QBFLG,(T1)	;GET HIS FLAG'S
 INS 2/41	;09C4
	;ON SKIP RETURN, T1 WILL STILL HAVE THE LOCK-BLOCK ADDRESS IN IT
 REP 2/43	;09C5
	;SUBROUTINE TO COUNT USERS QUEUED FOR A LOCK
 WIT
	;SUBROUTINE TO COUNT USERS SHARING A LOCK
 REP 7/43	;09C6
	;	HERE WITH COUNT IN T2
	;

	COUNTQ:	MOVE	T3,T1		;SAVE LOCK BLOCK ADDR
		MOVEI	T2,1		;INITIALIZE COUNTER
	COUNT2:	LOAD.	T1,.LBNQ,(T1)	;GET ADDR OF NEXT Q-BLOCK
		CAIN	T1,(T3)		;BACK AT START?
		POPJ	P,		;YES, RETURN
 WIT
	;	HERE WITH COUNT IN T2, LOCK-BLOCK-ADDR STILL IN T1
	;
	COUNTQ:	MOVE	T3,T1		;SAVE LOCK BLOCK ADDR
		SETZ	T2,		;INITIALIZE COUNTER
	COUNT2:	LOAD.	T3,.LBNQ,(T3)	;GET ADDR OF NEXT Q-BLOCK
		CAIN	T3,(T1)		;BACK AT START?
		POPJ	P,		;YES, RETURN
		LOAD.	T4,.QBFLG,(T3)	;GET Q-BLOCK FLAGS
		TRNN	T4,QBOWNR	;IS HE THE OWNER?
		JRST	COUNT2		;NO, DON'T COUNT THIS ENTRY
 REP 27/52	;09C7
	ENQMN4:	SOJG	P1,ENQMN1	;DECREMENT POINTER, LOOP OVER ALL
 WIT
	ENQMN4:	SOJGE	P1,ENQMN1	;DECREMENT POINTER, LOOP OVER ALL
 REP 28/53	;09C8
	ENQSD3:	SOJG	P1,ENQSD1	;DECREMENT POINTER, LOOP OVER ALL
 WIT
	ENQSD3:	SOJGE	P1,ENQSD1	;DECREMENT POINTER, LOOP OVER ALL
 REP 28/66	;09C9
	ENQND4:	SOJG	P1,ENQND1	;ADVANCE TO NEXT BIN HEADER
 WIT
	ENQND4:	SOJGE	P1,ENQND1	;ADVANCE TO NEXT BIN HEADER
 SUM 175815