comparison PR.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
comparison
equal deleted inserted replaced
3:ddb9ccfe3aa0 4:c689553e804e
230 { coreCtlr_Seq( NULL ); 230 { coreCtlr_Seq( NULL );
231 flushRegisters(); //Not sure why here, but leaving to be safe 231 flushRegisters(); //Not sure why here, but leaving to be safe
232 process->executionIsComplete = TRUE; 232 process->executionIsComplete = TRUE;
233 } 233 }
234 #else 234 #else
235 //First get the "ACK" lock, then do normal wait for signal, then release 235 //This is called from main thread, so must use OS thread constructs to
236 // ACK lock, to let end-process know it can free the process struct 236 // force the main thread to block (suspend) until it is signalled that
237 pthread_mutex_lock( &(process->doneAckLock) ); 237 // the process is complete. One issue is that the mutex and cond variable
238 // are inside the process data struct, which is freed when the process
239 // ends!
238 pthread_mutex_lock( &(process->doneLock) ); 240 pthread_mutex_lock( &(process->doneLock) );
239 while( process->executionIsComplete != TRUE ) 241 while( process->executionIsComplete != TRUE )
240 { 242 {
241 pthread_cond_wait( &(process->doneCond), 243 pthread_cond_wait( &(process->doneCond),
242 &(process->doneLock) ); 244 &(process->doneLock) );