comparison VMS.h @ 245:f1267bc7b342

added exceptions, make malloc in WL and App get master lock, added rand num
author Sean Halle <seanhalle@yahoo.com>
date Wed, 30 May 2012 14:23:47 -0700
parents 227cd4d33d94
children 4c7414df4f0e
comparison
equal deleted inserted replaced
119:45e63f8c98a3 120:498398089268
74 }; 74 };
75 //VMSReqst 75 //VMSReqst
76 76
77 enum VMSSemReqstType //These are equivalent to semantic requests, but for 77 enum VMSSemReqstType //These are equivalent to semantic requests, but for
78 { // VMS's services available directly to app, like OS 78 { // VMS's services available directly to app, like OS
79 createProbe = 1, // and probe services -- like a VMS-wide built-in lang 79 make_probe = 1, // and probe services -- like a VMS-wide built-in lang
80 throw_excp,
80 openFile, 81 openFile,
81 otherIO 82 otherIO
82 }; 83 };
83 84
84 typedef struct 85 typedef struct
85 { enum VMSSemReqstType reqType; 86 { enum VMSSemReqstType reqType;
86 SlaveVP *requestingSlv; 87 SlaveVP *requestingSlv;
87 char *nameStr; //for create probe 88 char *nameStr; //for create probe
89 char *msgStr; //for exception
90 void *exceptionData;
88 } 91 }
89 VMSSemReq; 92 VMSSemReq;
90 93
91 94
92 //==================== Core data structures =================== 95 //==================== Core data structures ===================
180 int32 setupComplete; //use while starting up coreCtlr 183 int32 setupComplete; //use while starting up coreCtlr
181 184
182 //Memory management related 185 //Memory management related
183 MallocArrays *freeLists; 186 MallocArrays *freeLists;
184 int32 amtOfOutstandingMem;//total currently allocated 187 int32 amtOfOutstandingMem;//total currently allocated
185 188
189 //Random number seeds -- random nums used in various places
190 uint32_t seed1;
191 uint32_t seed2;
192
186 //=========== MEASUREMENT STUFF ============= 193 //=========== MEASUREMENT STUFF =============
187 IntervalProbe **intervalProbes; 194 IntervalProbe **intervalProbes;
188 PrivDynArrayInfo *dynIntervalProbesInfo; 195 PrivDynArrayInfo *dynIntervalProbesInfo;
189 HashTable *probeNameHashTbl; 196 HashTable *probeNameHashTbl;
190 int32 masterCreateProbeID; 197 int32 masterCreateProbeID;
309 void 316 void
310 VMS_ext__dissipate_slaveVP( SlaveVP *slaveToDissipate ); 317 VMS_ext__dissipate_slaveVP( SlaveVP *slaveToDissipate );
311 318
312 void 319 void
313 VMS_int__throw_exception( char *msgStr, SlaveVP *reqstSlv, VMSExcp *excpData ); 320 VMS_int__throw_exception( char *msgStr, SlaveVP *reqstSlv, VMSExcp *excpData );
314 #define VMS_PI__throw_exception VMS_int__throw_exception 321 #define VMS_PI__throw_exception VMS_int__throw_exception
315 #define VMS_WL__throw_exception VMS_int__throw_exception 322 void
323 VMS_WL__throw_exception( char *msgStr, SlaveVP *reqstSlv, VMSExcp *excpData );
324 #define VMS_App__throw_exception VMS_WL__throw_exception
316 325
317 void * 326 void *
318 VMS_int__give_sem_env_for( SlaveVP *animSlv ); 327 VMS_int__give_sem_env_for( SlaveVP *animSlv );
319 #define VMS_PI__give_sem_env_for VMS_int__give_sem_env_for 328 #define VMS_PI__give_sem_env_for VMS_int__give_sem_env_for
320 #define VMS_SS__give_sem_env_for VMS_int__give_sem_env_for 329 #define VMS_SS__give_sem_env_for VMS_int__give_sem_env_for
321 //No WL version -- not safe! if use in WL, be sure data rd & wr is stable 330 //No WL version -- not safe! if use in WL, be sure data rd & wr is stable
322 331
332
333 inline void
334 VMS_int__get_master_lock();
335
336 #define VMS_int__release_master_lock() _VMSMasterEnv->masterLock = UNLOCKED
337
338 inline uint32_t
339 VMS_int__randomNumber();
340
323 //============== Request Related =============== 341 //============== Request Related ===============
324 342
325 void 343 void
326 VMS_int__suspend_slaveVP_and_send_req( SlaveVP *callingSlv ); 344 VMS_int__suspend_slaveVP_and_send_req( SlaveVP *callingSlv );
327 345