Skip to content

Task: Implement lock guard and shutdown functions per backend #2366

@RadWolfie

Description

@RadWolfie

Quick summary

We do not have feature-complete per backend usage to shutdown each one before we reboot multi-xbe titles or stop emulation. This is critical for prevent false positive crash on reboot and stop emulation while debugging and at least make progress to re-use same process without need to re-create new separate process.

Details

List of issues:

  • Direct3D9 (HLE)
    • Lock guard implement
    • Shutdown implement
    • Is coded in for lock and shutdown from CxbxrShutDown call.
  • OpenGL (LLE)
    • Lock guard implement
    • Shutdown implement
    • Is coded in for lock and shutdown from CxbxrShutDown call.
  • Renderer base
    • Lock guard implement
    • Shutdown implement
    • Is coded in for lock and shutdown from CxbxrShutDown call.
  • DirectSound
    • Lock guard implement
    • Shutdown implement
    • Is coded in for lock and shutdown from CxbxrShutDown call.
  • Input Manager
    • Lock guard implement
    • Shutdown implement
    • Is coded in for lock and shutdown from CxbxrShutDown call.
  • Timer
    • Lock guard implement
    • Shutdown implement
    • Is coded in for lock and shutdown from CxbxrShutDown call.
  • Virtual Memory Manager
    • Lock guard implement
    • Shutdown implement
    • Is coded in for lock and shutdown from CxbxrShutDown call.
  • Ob Manager
    • Lock guard implement
    • Shutdown implement
    • Is coded in for lock and shutdown from CxbxrShutDown call.
  • JVS
    • Lock guard implement
    • Shutdown implement
    • Is coded in for lock and shutdown from CxbxrShutDown call.
  • And possible LLE devices

What are needed to fix this type of problem.

  1. Implement class' lock function
  2. Implement class' shutdown function

Which then will be able to prevent xbox threads from using our active host's resources on shutdown process. The process for shutdown will be expecting to do:

  1. Lock all backends access point before xbox thread attempt to access host resources in middle of shutdown process.
  2. Suspend all xbox threads except for current thread.
  3. Shutdown all backends. (do clean up and release host resources)
  4. Start reboot process.

System Configuration:

N/A

Additional Information (if any):

Wine are prone to have this problem almost always. Windows rarely have this type of problem but cannot be ignored.

Metadata

Metadata

Assignees

No one assigned

    Labels

    buga real issue of the emulatorenhancementgeneral improvement of the emuhigh-prioritythis needs fixing asaprequesta task to be performed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions