home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / sybase / starbuck / java.z / threads_md.h < prev    next >
C/C++ Source or Header  |  1996-05-03  |  2KB  |  58 lines

  1. /*
  2.  * @(#)threads_md.h    1.16 95/11/20
  3.  *
  4.  * Copyright (c) 1995 Sun Microsystems, Inc. All Rights Reserved.
  5.  *
  6.  * Permission to use, copy, modify, and distribute this software
  7.  * and its documentation for NON-COMMERCIAL purposes and without
  8.  * fee is hereby granted provided that this copyright notice
  9.  * appears in all copies. Please refer to the file "copyright.html"
  10.  * for further important copyright and licensing information.
  11.  *
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
  13.  * THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
  14.  * TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
  15.  * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR
  16.  * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
  17.  * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
  18.  */
  19.  
  20. /*
  21.  * Win32 implementation of Java threads
  22.  */
  23.  
  24. #ifndef _WIN32_THREADS_MD_H_
  25. #define _WIN32_THREADS_MD_H_
  26.  
  27. #include <windows.h>
  28. #include "bool.h"
  29.  
  30. #define N_TRACED_REGS 6
  31.  
  32. typedef enum {
  33.     RUNNABLE,
  34.     SUSPENDED,
  35.     SLEEPING,
  36.     MONITOR_WAIT,
  37.     CONDVAR_WAIT
  38. } thread_state_t;
  39.  
  40. /*
  41.  * Machine dependent thread data structure
  42.  */
  43. typedef struct sys_thread {
  44.     void *cookie;            /* Back-pointer to shared thread struct */
  45.     HANDLE handle;            /* Win32 thread handle */
  46.     unsigned long id;           /* Win32 thread id */
  47.     void *stack_base;           /* Thread stack base */
  48.     thread_state_t state;        /* Current thread state */
  49.     bool_t system_thread;        /* TRUE if this is a system thread */
  50.     void *(*start_proc)(void *);    /* Thread start routine address */
  51.     void *start_parm;            /* Thread start routine parameter */
  52.     struct sys_thread *next;        /* Next thread in active thread queue */
  53. } sys_thread_t;
  54.  
  55. extern bool_t ThreadsInitialized;
  56.  
  57. #endif /* !_WIN32_THREADS_MD_H_ */
  58.