tile_load_queue.push( tile );
}
+#ifdef WISH_PLIB_WAS_THREADED // but it isn't
/**
*
*/
{
tile_free_queue.push( tile );
}
+#endif
/**
*
FGTileMgr::ready_to_attach( tile );
+#ifdef WISH_PLIB_WAS_THREADED // but it isn't
// Handle and pending removals
while ( !loader->tile_free_queue.empty() ) {
cout << "freeing next tile ..." << endl;
tile->free_tile();
delete tile;
}
+#endif
+
}
pthread_cleanup_pop(1);
}
*/
void add( FGTileEntry* tile );
+#ifdef WISH_PLIB_WAS_THREADED // but it isn't
/**
* Remove a tile from memory.
* @param tile The tile to be removed from memory.
*/
void remove( FGTileEntry* tile );
+#endif
/**
* The tile loader thread will only load one tile per call to the
* FIFO queue of tiles to load from data files.
*/
SGBlockingQueue< FGTileEntry * > tile_load_queue;
- SGBlockingQueue< FGTileEntry * > tile_free_queue;
+ // SGBlockingQueue< FGTileEntry * > tile_free_queue;
#else
queue< FGTileEntry * > tile_load_queue;
- queue< FGTileEntry * > tile_free_queue;
+ // queue< FGTileEntry * > tile_free_queue;
#endif
/**
SG_LOG( SG_TERRAIN, SG_DEBUG, "FREEING CACHE ENTRY = " << cache_index );
FGTileEntry *tile = tile_cache[cache_index];
tile->disconnect_ssg_nodes();
- tile->sched_removal();
-#if 0
+#ifdef WISH_PLIB_WAS_THREADED
+ tile->sched_removal();
+#else // plib isn't threaded so we always go here
tile->free_tile();
delete tile;
#endif
}
+#ifdef WISH_PLIB_WAS_THREADED // but it isn't
+
// Schedule tile to be freed/removed
void FGTileEntry::sched_removal() {
global_tile_mgr.ready_to_delete( this );
}
+#endif
+
// Clean up the memory used by this tile and delete the arrays used by
// ssg as well as the whole ssg branch
// Destructor
~FGTileEntry();
+#ifdef WISH_PLIB_WAS_THREADED // but it isn't
// Schedule tile to be freed/removed
void sched_removal();
+#endif
// Clean up the memory used by this tile and delete the arrays
// used by ssg as well as the whole ssg branch
*/
static void ready_to_attach( FGTileEntry *t ) { attach_queue.push( t ); }
+#ifdef WISH_PLIB_WAS_THREADED // but it isn't
/**
* Tile is detatched from scene graph and is ready to delete
*/
inline void ready_to_delete( FGTileEntry *t ) { loader.remove( t ); }
+#endif
/**
* Add a pending model to the 'deferred model load' queue