void create_thread()

in src/cubeb_wasapi.cpp [548:580]


  void create_thread()
  {
    output_changed = CreateEvent(nullptr, 0, 0, nullptr);
    if (!output_changed) {
      LOG("Failed to create output changed event.");
      return;
    }

    input_changed = CreateEvent(nullptr, 0, 0, nullptr);
    if (!input_changed) {
      LOG("Failed to create input changed event.");
      return;
    }

    begin_shutdown = CreateEvent(nullptr, 0, 0, nullptr);
    if (!begin_shutdown) {
      LOG("Failed to create begin_shutdown event.");
      return;
    }

    shutdown_complete = CreateEvent(nullptr, 0, 0, nullptr);
    if (!shutdown_complete) {
      LOG("Failed to create shutdown_complete event.");
      return;
    }

    thread = (HANDLE)_beginthreadex(nullptr, 256 * 1024, thread_proc, this,
                                    STACK_SIZE_PARAM_IS_A_RESERVATION, nullptr);
    if (!thread) {
      LOG("Failed to create thread.");
      return;
    }
  }