/*
 * $RCSfile: gc.h,v $
 *
 * x-kernel v3.3
 *
 * Copyright (c) 1993,1991,1990,1996  Arizona Board of Regents
 *
 * $Log: gc.h,v $
 * Revision 1.2  1996/01/29 20:25:55  slm
 * Updated copyright and version.
 *
 * Revision 1.1  1995/07/28  21:29:10  slm
 * Initial revision
 *
 * Revision 1.6.3.1  1994/10/27  20:47:51  hkaram
 * New branch
 *
 * Revision 1.6  1993/12/10  02:38:56  menze
 * Fixed #endif
 */

#ifndef gc_h
#define gc_h

#include "xkernel.h"
#include "idmap.h"

/*
 * initSessionCollector -- start a session garbage collector to run every
 * 'interval' microseconds, collecting  idle sessions on map 'm' (an idle
 * session is one whose ref count is zero.)   A session is collected by calling
 * the function 'destructor'.   Protocols mark a session as 'non-idle' by
 * clearing it's 'idle' field.
 *
 * 'msg' is a string used in trace statements to identify the collector.
 * (try to use a string unique to the map, such as a protocol name)
 * A null pointer is interpreted as an empty string.
 *
 * There is currently no way to shut down a session collector.
 */

#ifdef __STDC__
typedef void (*SessnGCDestructor)(Sessn);
#else
typedef void (*SessnGCDestructor)();
#endif

#ifdef __STDC__
void initSessionCollector(Map m, int interval, SessnGCDestructor destructor,
			  char *msg);
#else
void initSessionCollector();
#endif

#endif	/* gc_h */
