/*static char *SCCSID = "@(#)chkoft.c	6.1 90/11/17";*/
/*static char *SCCSID = "@(#)chkoft.c      13.2 90/01/25";*/
#include <os2def.h>

#include "const.h"
#include "misc.h"
#include "chain.h"
#include "buf.h"
#include "dir.h"
#include "volume.h"
#include "storage.h"
#include "tables.h"
#include "pb_ifs.h"
#include "lw.h"
#include "frame.h"
#include "fsdata.h"
#include "assert.h"

#include "pr_CACHE.h"
#include "pr_DEBUG.h"
#include "pr_MISC.h"


/***	ChkOFT - Check OFT structures
 *
 *	check to make sure that all are unlocked and unheld
 *
 *	ENTRY	none
 *	EXIT	none
 *
 */


void far
ChkOFT () {

#ifdef DEBUG

	POFT poftCur;	/*  Used to traverse the OFT list  */

	poftCur = (POFT) oftHead.pFwd;
	while (poftCur != (POFT) &oftHead) {
	    if ((poftCur->bFlag & OTF_LCK) == 0) {
		/* OFT is not locked, so check it out */
		ASSERT_OFT (poftCur);

		if (poftCur->cWaits || poftCur -> cusHolds || poftCur -> bFlag) {
		    if (!fMTFlag)
			INTERR ("ChkOFT--OFT held or locked in non-multitasking mode.");

		    if (poftCur -> cusHolds & 0x8000)
			INTERR ("ChkOFT:  OFT hold count underflowed.");
		    }
	    }

	    poftCur = (POFT) poftCur -> dcpOFTList.pFwd;
	    }


#endif
}
