changeset 7:778e36c0aa61

Version before optimization
author Merten Sach <msach@mailbox.tu-berlin.de>
date Mon, 04 Jul 2011 19:43:45 +0200
parents ce4ad44fcc23
children a2ff41577ecb
files VPThread_PluginFns.c VPThread_Request_Handlers.c
diffstat 2 files changed, 15 insertions(+), 14 deletions(-) [+]
line diff
     1.1 --- a/VPThread_PluginFns.c	Thu Jun 16 14:39:38 2011 +0200
     1.2 +++ b/VPThread_PluginFns.c	Mon Jul 04 19:43:45 2011 +0200
     1.3 @@ -79,7 +79,7 @@
     1.4           case dissipate:    handleDissipate(           requestingPr, semEnv);
     1.5              break;
     1.6           case VMSSemantic:  VMS__handle_VMSSemReq(req, requestingPr, semEnv,
     1.7 -                                                              &resume_procr);
     1.8 +                                                (ResumePrFnPtr)&resume_procr);
     1.9              break;
    1.10           default:
    1.11              break;
    1.12 @@ -153,11 +153,13 @@
    1.13  handleCreate( VMSReqst *req, VirtProcr *requestingPr, VPThdSemEnv *semEnv  )
    1.14   { VPThdSemReq *semReq;
    1.15     VirtProcr    *newPr;
    1.16 -
    1.17 -         Meas_startCreate
    1.18 -
    1.19 +    
    1.20 +    //========================= MEASUREMENT STUFF ======================
    1.21 +    Meas_startCreate
    1.22 +    //==================================================================
    1.23 +     
    1.24     semReq = VMS__take_sem_reqst_from( req );
    1.25 -
    1.26 +   
    1.27     newPr = VPThread__create_procr_helper( semReq->fnPtr, semReq->initData, 
    1.28                                            semEnv, semReq->coreToScheduleOnto);
    1.29  
    1.30 @@ -167,15 +169,15 @@
    1.31     resume_procr( newPr,        semEnv );
    1.32     resume_procr( requestingPr, semEnv );
    1.33  
    1.34 -         //========================= MEASUREMENT STUFF ======================
    1.35 +     //========================= MEASUREMENT STUFF ======================
    1.36           Meas_endCreate
    1.37 -         #ifdef MEAS__TIME_PLUGIN
    1.38 -         #ifdef MEAS__SUB_CREATE
    1.39 +     #ifdef MEAS__TIME_PLUGIN
    1.40 +     #ifdef MEAS__SUB_CREATE
    1.41           subIntervalFromHist( startStamp, endStamp,
    1.42                                          _VMSMasterEnv->reqHdlrHighTimeHist );
    1.43 -         #endif
    1.44 -         #endif
    1.45 -         //==================================================================
    1.46 +     #endif
    1.47 +     #endif
    1.48 +     //==================================================================
    1.49   }
    1.50  
    1.51  
     2.1 --- a/VPThread_Request_Handlers.c	Thu Jun 16 14:39:38 2011 +0200
     2.2 +++ b/VPThread_Request_Handlers.c	Mon Jul 04 19:43:45 2011 +0200
     2.3 @@ -25,7 +25,7 @@
     2.4     VirtProcr   *requestingPr;
     2.5  
     2.6     requestingPr = semReq->requestingPr;
     2.7 -   newMutex = VMS__malloc( sizeof(VPThdMutex) );
     2.8 +   newMutex = VMS__malloc( sizeof(VPThdMutex)  );
     2.9     newMutex->waitingQueue = makeVMSPrivQ( requestingPr );
    2.10     newMutex->holderOfLock = NULL;
    2.11  
    2.12 @@ -44,7 +44,6 @@
    2.13  inline void
    2.14  handleMutexLock( VPThdSemReq *semReq, VPThdSemEnv *semEnv)
    2.15   { VPThdMutex  *mutex;
    2.16 -
    2.17     //===================  Deterministic Replay  ======================
    2.18     #ifdef RECORD_DETERMINISTIC_REPLAY
    2.19     
    2.20 @@ -58,7 +57,7 @@
    2.21     if( mutex->holderOfLock == NULL ) //none holding, give lock to requester
    2.22      {
    2.23        mutex->holderOfLock = semReq->requestingPr;
    2.24 -
    2.25 +      
    2.26           //re-animate requester, now that it has the lock
    2.27        resume_procr( semReq->requestingPr, semEnv );
    2.28      }