Beispiel #1
0
static void ps3_audio_free(void *data)
{
   uint64_t val;
   ps3_audio_t *aud = data;

   aud->quit_thread = true;
   ps3_audio_start(aud);
   sys_ppu_thread_join(aud->thread, &val);

   ps3_audio_stop(aud);
   cellAudioPortClose(aud->audio_port);
   cellAudioQuit();
   fifo_free(aud->buffer);

   sys_lwmutex_destroy(&aud->lock);
   sys_lwmutex_destroy(&aud->cond_lock);
   sys_lwcond_destroy(&aud->cond);

   free(data);
}
Beispiel #2
0
static void audioport_free(cell_audio_handle_t handle)
{
   audioport_t *port = handle;

   port->quit_thread = 1;
   pthread_join(port->thread, NULL);

   sys_lwmutex_destroy(&port->lock);
   sys_lwmutex_destroy(&port->cond_lock);
   sys_lwcond_destroy(&port->cond);

   if (port->re)
      resampler_free(port->re);
   if (port->buffer)
      fifo_free(port->buffer);

   cellAudioPortStop(port->audio_port);
   cellAudioPortClose(port->audio_port);

   free(port);
}
Beispiel #3
0
void ext2DeinitVolume (ext2_vd *vd)
{
    // Sanity check
    if (!vd) {
        errno = ENODEV;
        return;
    }

    // Lock
    ext2Lock(vd);

    // Close any directories which are still open (lazy programmers!)
    ext2_dir_state *nextDir = vd->firstOpenDir;
    while (nextDir) {
        ext2CloseDir(nextDir);
        nextDir = nextDir->nextOpenDir;
    }

    // Close any files which are still open (lazy programmers!)
    ext2_file_state *nextFile = vd->firstOpenFile;
    while (nextFile) {
       ext2CloseFile(nextFile);
       nextFile = nextFile->nextOpenFile;
    }

    // Reset open directory and file stats
    vd->openDirCount = 0;
    vd->openFileCount = 0;
    vd->firstOpenDir = NULL;
    vd->firstOpenFile = NULL;

    // Force the underlying device to sync
    ext2Sync(vd, NULL);

    // Unlock
    ext2Unlock(vd);

    // Deinitialise the volume lock
    //LWP_MutexDestroy(vd->lock);
    sys_lwmutex_destroy(&vd->lock);
}
int __libc_lock_close(__libc_lock_t *lock)
{
  return sys_lwmutex_destroy(lock);
}