#ifndef __OOL_XTHREAD_H__
#define __OOL_XTHREAD_H__

/*===========================================================================*/
/* OOL ------------------- the Open Object Library ------------- OS/2 Beta 1 */
/*===========================================================================*/
/*                              class: XThread                               */
/*                       derived from: XProcess                              */
/*                        last update: 2/97                                  */
/*                      programmed by: Stefan von Brauk (sbrauk@gwdg.de)     */
/*===========================================================================*/

#include "xprocess.h"


class _export_ XThread: public XProcess
{
      #ifndef __WATCOMC__
      friend void _Optlink StartUp(void * v);
      #else
      friend void StartUp( void* v );
      #endif
   private:
		TID tid;
      LONG stackSize;
      #ifndef __WATCOMC__
      static int threadsRunning;
      #endif
      void ThreadEntry( void );
   public:
      void Run();
      virtual void Init( void ) { ;}
      static void RunThreads( void );
      XThread( const LONG stack = 128000 ) { stackSize = stack; }
		ULONG Resume();
		ULONG Suspend();
      virtual void Terminate( void );
};


#endif
