The DejaVU Framework -- hush 3.0
[.] Papers Tutorials Examples Manuals Interfaces Sources Packages Resources ?

include: thread.h hush-3.0b4/auxiliary/net/thread


[.] - [up] [top] - index README make include source scripts
  ifndef HUSH_THREAD_H
  define HUSH_THREAD_H
  
  // thread.h
  
  // simple thread package, based on solaris threads
  
  // September, October 1995
  // Bastiaan Sch\"onhage
  
  // options for the constructor include:
  // bound: this thread will be bound on a specific LWP (slow)
  // detached: this thread cannot be joined; resources are freed on exit
  // daemon: mark this thread as a daemon thread, will be killed if ...
  
  ifndef _REENTRANT
  define _REENTRANT
  endif
  
  include <hush/export.h>
  
  

thread


  class  thread {
          
        public:
          thread( char* options = "" );        // constructor and
          virtual ~thread() {};

slide: thread

                // destructor of thread object
          
          virtual int main();                // will be called at start of thread
  
          // methods on this thread class
          int run();                        // start the thread
          void kill();                        // kill this thread
          void suspend();                        // suspend until continue
          void resume();                        // continue the suspended thread
          int priority();                        // returns the priority of this thread
          void priority(int pri);                // set the priority
          unsigned id();                        // give thread id
  
          void exit(int status = 0 );        // exit current running thread ?? AE
  
          // methods on current running thread
        protected:
          unsigned self();                // returns thread id of current thread
          void yield();                        // yield execution to another thread
          
          virtual void error( char* s = "" );        // this function will be
                                                  // called on error
  
        public:
          // general methods for threads
          void setconcurrency(int n = 2); // set nr of concurrent threads
          // wait till completion of a specific thread, or of any (waitfor=0)
          static unsigned join( unsigned waitfor = 0, void* status = 0 ); 
          
        private:
          static void* act;
          unsigned t; 
          int opt;
  };
  
  endif
  

[.] Papers Tutorials Examples Manuals Interfaces Sources Packages Resources ?
Hush Online Technology
hush@cs.vu.nl
09/09/98