Exemplo n.º 1
0
// Called by CAVElib, on each of the child rendering processes
void CaveScene::draw(DisplayDevice *display) {
#if defined(CAVEUSERWLOCK)
  if (display->is_renderer_process()) {
    CAVESetReadLock(draw_rwlock);
    Scene::draw(display);                // draw the scene
    CAVEUnsetReadLock(draw_rwlock);
  } else {
    CAVEUnsetWriteLock(draw_rwlock);
    vmd_msleep(1); // give 'em 1 millisecond to draw before re-locking 
    CAVESetWriteLock(draw_rwlock);
  }
#else
  // Barrier synchronization for all drawing processes and the master
  vmd_thread_barrier(draw_barrier, 0); // wait for start of drawing 
  Scene::draw(display);                // draw the scene
  vmd_thread_barrier(draw_barrier, 0); // wait for end of drawing.
#endif
}
Exemplo n.º 2
0
void vrlib_lock_off (void *lock)
{
    CAVEUnsetReadLock ((CAVELOCK) lock);
    return;
}