/* Prototypes for CS6210 Project 2, Fall 1999 "GTHreads" */ /* DO NOT EDIT */ /* Definitions for return values */ #define GT_SUCCESS 0 #define GT_FAILED 1 #define GT_MUTEX void* /* Type of a mutex */ int GThread_init( /* Initialize GTHreads package */ int SchedulingInterval); /* Context switch interval, in microseconds */ /* If 0 specified, NO PREEMPTION! */ /* Return GT_SUCCESS if Succeeded */ int GThread_create( /* Create a new thread */ void* pStartFunc, /* Address of starting function for thread */ void* pParam, /* Address of a parameter to be passed to thread */ int StackSize); /* Size of stack for this thread */ /* Return GT_SUCCESS if Succeeded */ void GThread_yield(void);/* Relinquish control of CPU to another thread */ void GThread_exit(void);/* Notify scheduler that thread has completed */ /* DOES NOT RETURN */ int GThread_count(); /* Return number of threads active */ /* Mutex related calls */ int GTMutex_create( /* Create a new mutex */ GT_MUTEX* pMutex); /* Address of mutex to create */ /* Return GT_SUCCESS if Succeeded */ void GTMutex_lock( /* Lock the specified mutex */ GT_MUTEX Mutex); /* Mutex to lock */ int GTMutex_unlock( /* Unlock the specified mutex */ GT_MUTEX Mutex); /* Mutex to unlock */ int GTMutex_islocked( /* Return status of mutex, 1 = locked, 0 = not locked */ GT_MUTEX Mutex); /* Mutex to check */ int GTMutex_SCount( /* Return number of successful locks */ GT_MUTEX Mutex); /* Mutex to check */ int GTMutex_UCount( /* Return number of unsuccessful locks */ GT_MUTEX Mutex); /* Mutex to check */