diff PR__SS.c @ 286:b02b34681414

VReo V2 -- saves checker and doer fn with the port, where triggered
author Sean Halle <seanhalle@yahoo.com>
date Wed, 10 Jul 2013 14:49:04 -0700
parents 7b6f8cf08b1f
children 744b5ff9851e
line diff
     1.1 --- a/PR__SS.c	Wed Jun 12 14:12:06 2013 -0700
     1.2 +++ b/PR__SS.c	Wed Jul 10 14:49:04 2013 -0700
     1.3 @@ -363,10 +363,13 @@
     1.4           // return.
     1.5        return;
     1.6       #else
     1.7 +      //Here, must use OS thread constructs.. the main thread is waiting for
     1.8 +      // PR process to complete.  So, at this point, cause main to resume.
     1.9 +       
    1.10        pthread_mutex_lock(     &(process->doneLock) );
    1.11        process->executionIsComplete = TRUE;
    1.12 +      pthread_cond_broadcast( &(process->doneCond) );
    1.13        pthread_mutex_unlock(   &(process->doneLock) );
    1.14 -      pthread_cond_broadcast( &(process->doneCond) );
    1.15           //now wait for woken waiter to Ack, then free the process struct
    1.16        pthread_mutex_lock(     &(process->doneAckLock)  ); //BUG:? may be a race
    1.17        pthread_mutex_unlock(   &(process->doneAckLock)  );  
    1.18 @@ -378,8 +381,8 @@
    1.19      { 
    1.20        pthread_mutex_lock(     &(_PRTopEnv->activityDoneLock) );
    1.21        _PRTopEnv->allActivityIsDone = TRUE;
    1.22 +      pthread_cond_broadcast( &(_PRTopEnv->activityDoneCond) );
    1.23        pthread_mutex_unlock(   &(_PRTopEnv->activityDoneLock) );
    1.24 -      pthread_cond_broadcast( &(_PRTopEnv->activityDoneCond) );
    1.25      }
    1.26   }
    1.27