diff VMS.h @ 24:2b161e1a50ee

1st working version -- as far as can tell due to SEH bugs
author Me
date Wed, 07 Jul 2010 13:15:54 -0700
parents aa634ef7cc35
children c556193f7211
line diff
     1.1 --- a/VMS.h	Wed Jun 30 13:11:06 2010 -0700
     1.2 +++ b/VMS.h	Wed Jul 07 13:15:54 2010 -0700
     1.3 @@ -29,7 +29,7 @@
     1.4  //#define thdAttrs NULL  //For PThreads
     1.5  
     1.6  typedef struct _SchedSlot  SchedSlot;
     1.7 -typedef struct _SlaveReqst VMSReqst;
     1.8 +typedef struct _VMSReqst VMSReqst;
     1.9  typedef struct _VirtProcr  VirtProcr;
    1.10  
    1.11  typedef VirtProcr * (*SlaveScheduler)  ( void * );        //semEnv
    1.12 @@ -59,18 +59,19 @@
    1.13   {
    1.14     semantic = 1,
    1.15     dissipate,
    1.16 +   regCreated,
    1.17     IO
    1.18   };
    1.19  
    1.20 -struct _SlaveReqst
    1.21 +struct _VMSReqst
    1.22   {
    1.23  //   VirtProcr   *virtProcrFrom;
    1.24 -   enum ReqstType  reqType;  //used for dissipate and in future for IO requests
    1.25 +   enum ReqstType  reqType;//used for dissipate and in future for IO requests
    1.26     void           *semReqData;
    1.27  
    1.28     VMSReqst *nextReqst;
    1.29   };
    1.30 -//SlaveReqst
    1.31 +//VMSReqst
    1.32  
    1.33  struct _VirtProcr
    1.34   { int         procrID;  //for debugging -- count up each time create
    1.35 @@ -142,7 +143,7 @@
    1.36  VMS__init();
    1.37  
    1.38  void
    1.39 -VMS__start();
    1.40 +VMS__start_the_work_then_wait_until_done();
    1.41  
    1.42  VirtProcr *
    1.43  VMS__create_procr( VirtProcrFnPtr fnPtr, void *initialData );
    1.44 @@ -150,15 +151,37 @@
    1.45  VirtProcr *
    1.46  VMS__create_the_shutdown_procr();
    1.47  
    1.48 +//==========================
    1.49  inline void
    1.50 -VMS__send_sem_request( void *semReqData, VirtProcr *callingPr );
    1.51 +VMS__add_sem_request( void *semReqData, VirtProcr *callingPr );
    1.52  
    1.53  void
    1.54 -VMS__send_dissipate_request( VirtProcr *procrToDissipate );
    1.55 +VMS__send_register_new_procr_request( VirtProcr *newPrToRegister,
    1.56 +                                      VirtProcr *reqstingPr );
    1.57 +
    1.58 +void
    1.59 +VMS__free_request( VMSReqst *req );
    1.60  
    1.61  void
    1.62  VMS__remove_and_free_top_request( VirtProcr *reqstingPr );
    1.63  
    1.64 +VMSReqst *
    1.65 +VMS__take_top_request_from( VirtProcr *reqstingPr );
    1.66 +
    1.67 +inline void *
    1.68 +VMS__take_sem_reqst_from( VMSReqst *req );
    1.69 +
    1.70 +inline int
    1.71 +VMS__isSemanticReqst( VMSReqst *req );
    1.72 +
    1.73 +inline int
    1.74 +VMS__isDissipateReqst( VMSReqst *req );
    1.75 +
    1.76 +inline int
    1.77 +VMS__isCreateReqst( VMSReqst *req );
    1.78 +
    1.79 +//==========================
    1.80 +
    1.81  void
    1.82  VMS__suspend_procr( VirtProcr *callingPr );
    1.83