/*-=-=-=-=-=-=-=-=-=-=-=- RCCL/RCI Notice of Copyright -=-=-=-=-=-=-=-=-=-=-*
 *									    *
 *	Copyright (C) 1991 by John E. Lloyd.				    *
 *									    *
 *	Information on copyright permissions, as well as a complete	    *
 *	disclaimer of warranty, is given in the file COPYRIGHT.		    *
 *									    *
 *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
#include "../h/rciTask.h"
#include "../h/rcclDefs.h"
#include "../h/rciConfig.h"

#include "../rccl/rcclAutoAbort.h"

extern RCI_DESC *rcclTd[];

rcclActive()
{
	/* returns true if the RCCL tasks are running */

	int k;

	if (!INSIDE_PLANNING_TASK())	/* trivially true */
	 { return (1);
	 }
	for (k=0; k<MAX_CPUS && !rcclTd[k]; k++)
	   ;
	if (k == MAX_CPUS)
	 { return (0);			/* trivially false */
	 }
	for ( ; k<MAX_CPUS; k++)
	 { if (rcclTd[k] && rcclTd[k]->tcb->controlMode != ACTIVE)
	    { return (0);
	    }
	 }
	return (1);
}
