home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1998 February / VPR9802A.ISO / APP_DEMO / VC / MAIN.BIN / threads_md.h < prev    next >
C/C++ Source or Header  |  1997-10-27  |  2KB  |  72 lines

  1. /*
  2.  * @(#)threads_md.h    1.24 96/11/23
  3.  * 
  4.  * Copyright (c) 1995, 1996 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  * CopyrightVersion 1.1_beta
  20.  * 
  21.  */
  22.  
  23. /*
  24.  * Win32 implementation of Java threads
  25.  */
  26.  
  27. #ifndef _WIN32_THREADS_MD_H_
  28. #define _WIN32_THREADS_MD_H_
  29.  
  30. #include <windows.h>
  31. #include "bool.h"
  32.  
  33. #define N_TRACED_REGS 7
  34.  
  35. #define SYS_THREAD_NULL         ((sys_thread_t *) 0)
  36.  
  37. /*
  38.  * Machine dependent info in a sys_thread_t: Keep these values in
  39.  * sync with the string array used by sysThreadDumpInfo() in threads_md.c!
  40.  */
  41. typedef enum {
  42.     FIRST_THREAD_STATE,
  43.     RUNNABLE = FIRST_THREAD_STATE,
  44.     SUSPENDED,
  45.     MONITOR_WAIT,
  46.     CONDVAR_WAIT,
  47.     MONITOR_SUSPENDED,
  48.     NUM_THREAD_STATES
  49. } thread_state_t;
  50.  
  51. /*
  52.  * Machine dependent thread data structure
  53.  */
  54. typedef struct sys_thread {
  55.     void *cookie;            /* Back-pointer to shared thread struct */
  56.     HANDLE handle;            /* Win32 thread handle */
  57.     unsigned long id;           /* Win32 thread id */
  58.     void *stack_base;           /* Thread stack base */
  59.     thread_state_t state;        /* Current thread state */
  60.     bool_t system_thread;        /* TRUE if this is a system thread */
  61.     HANDLE interrupt_event;        /* Event signaled on thread interrupt */
  62.     bool_t interrupted;            /* Shadow thread interruption */
  63.     bool_t vmsuspended;            /* This thread is suspended */
  64.     void *(*start_proc)(void *);    /* Thread start routine address */
  65.     void *start_parm;            /* Thread start routine parameter */
  66.     struct sys_thread *next;        /* Next thread in active thread queue */
  67. } sys_thread_t;
  68.  
  69. extern bool_t ThreadsInitialized;
  70.  
  71. #endif /* !_WIN32_THREADS_MD_H_ */
  72.