enum vg_thread_purpose vg_thread_purpose(void);
enum engine_status _vg_engine_status(void);
-/*
- * Allocate an asynchronous call with a bit of memory
- */
vg_async_item *vg_async_alloc( u32 size )
{
/* ditch out here if engine crashed. this serves as the 'quit checking' */
void vg_async_stall(void)
{
vg_assert_thread(k_thread_purpose_loader);
-#if 0
- vg_info( "async_stall: %d\n", SDL_SemValue( vg_async.sem_wait_for_flush ) );
-#endif
SDL_SemWait( vg_async.sem_wait_for_flush );
}
-/*
- * Mark the call as being filled and ready to go
- */
void vg_async_dispatch( vg_async_item *item,
void (*runner)( void *payload, u32 size ) )
{
SDL_AtomicUnlock( &vg_async.sl_index );
}
-/*
- * Make a simple async call without allocating extra.
- */
void vg_async_call( void (*runner)( void *payload, u32 size ),
void *payload, u32 size )
{
vg_async_dispatch( call, runner );
}
-/*
- * Run as much of the async buffer as possible
- */
void vg_run_async_checked(void)
{
SDL_AtomicLock( &vg_async.sl_index );
}
}
}
- else{
+ else
+ {
SDL_AtomicUnlock( &vg_async.sl_index );
return;
}
-
- /* TODO: if exceed max frametime.... */
}
if( !SDL_SemValue( vg_async.sem_wait_for_flush ) ){
static void vg_assert_thread( enum vg_thread_purpose required );
typedef struct vg_async_item vg_async_item;
-struct vg_async_item{
+struct vg_async_item
+{
vg_async_item *next;
void *payload;
}
extern vg_async;
-/* TODO: Docu */
+void vg_async_init(void);
+/*
+ * Make a simple async call without allocating extra.
+ */
void vg_async_call( void (*runner)( void *payload, u32 size ),
void *payload, u32 size );
+
+/*
+ * Run as much of the async buffer as possible
+ */
void vg_run_async_checked(void);
-void vg_async_init(void);
+/*
+ * Allocate an asynchronous call with a bit of memory
+ */
vg_async_item *vg_async_alloc( u32 size );
+
/*
* Mark the call as being filled and ready to go
*/