home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / f / ftp-102.zip / ftape-1.02 / driver / thread.h < prev    next >
Text File  |  1992-10-12  |  1KB  |  55 lines

  1. /* Declarations for lightweight threads.
  2.    Copyright (C) 1992 David L. Brown, Jr.
  3.  
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 2, or (at your option)
  7. any later version.
  8.  
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. GNU General Public License for more details.
  13.  
  14. You should have received a copy of the GNU General Public License
  15. along with this program; see the file COPYING.  If not, write to
  16. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  17.  
  18. /*
  19.  * thread.h,v 1.3 1992/10/13 01:45:04 dbrown Exp
  20.  *
  21.  * thread.h,v
  22.  * Revision 1.3  1992/10/13  01:45:04  dbrown
  23.  * Added FSF copyright.
  24.  *
  25.  * Revision 1.2  1992/09/07  16:44:04  dbrown
  26.  * Changed names of routines for Kernel use.
  27.  *
  28.  * Revision 1.1  1992/09/07  14:46:26  dbrown
  29.  * Added thread code.
  30.  *
  31.  */
  32.  
  33. /* Handle a distinct thread. */
  34.  
  35. typedef struct {
  36.   long bx, si, di;
  37.   void *bp;
  38.   void *sp;
  39.   void *pc;
  40. } thread_state;
  41.  
  42. typedef struct {
  43.   long *stack;
  44.   thread_state master;
  45.   thread_state slave;
  46. } thread;
  47.  
  48. typedef void func ();
  49.  
  50. int th_create (thread *th, int stack_size,
  51.            void *stack,
  52.            func *function, void *arg);
  53. void *th_thunk (thread *th, void *arg);
  54. void *th_suspend (thread *th, void *arg);
  55.