test/opengl_interop/main.c
void*
thread_image_run(void* arg)
{
    struct application* app = (struct application*)arg;
    
    gpujpeg_init_device(0, GPUJPEG_OPENGL_INTEROPERABILITY);

    // Wait until work thread is ready to render image
    while ( app->image == NULL ) {
        usleep(1000);
        continue;
    }
    
    // Generated image in loop until view thread quit
    while ( app->quit == 0 ) {
        usleep(30000);
        
        image_generate(app);
    }
    
    return 0;
}
/**
 * Thread that in loop generates images. For every generated image it detaches
 * CUDA context and wait until view thread load that image by detached CUDA context
 */
Thread that in loop generates images. For every generated image it detaches
CUDA context and wait until view thread load that image by detached CUDA context
Thread that in loop generates images . For every generated image it detaches CUDA context and wait until view thread load that image by detached CUDA context
void*
thread_image_run(void* arg)
{
    struct application* app = (struct application*)arg;
    gpujpeg_init_device(0, GPUJPEG_OPENGL_INTEROPERABILITY);
    while ( app->image == NULL ) {
        usleep(1000);
        continue;
    }
    while ( app->quit == 0 ) {
        usleep(30000);
        image_generate(app);
    }
    return 0;
}
void * thread_image_run ( void * arg ) { struct application * app = ( struct application * ) arg ; gpujpeg_init_device ( 0 , GPUJPEG_OPENGL_INTEROPERABILITY ) ; while ( app -> image == NULL ) { usleep ( 1000 ) ; continue ; } while ( app -> quit == 0 ) { usleep ( 30000 ) ; image_generate ( app ) ; } return 0 ; }
Thread that in loop generates images.
Thread that in loop generates images .
// Wait until work thread is ready to render image // Generated image in loop until view thread quit