Description
A deadlock can occur when disposing an event subscription if a pending request is in the callback method and waiting to obtain a lock on _serverData.SyncObj.
When disposing the event subscription any pending requests are waited on to complete whilst the waiting thread holds a lock on _serverData.SyncObj here - https://github.com/MediaPortal/MediaPortal-2/blob/25f5c755477efdcc8c4919324bcf450b86131222/MediaPortal/Source/Core/UPnP/Infrastructure/Dv/GENA/EventSubscription.cs#L155
If the request thread is currently in a callback and is itself waiting to obtain _serverData.SyncObj then a deadlock will occur, e.g. here - https://github.com/MediaPortal/MediaPortal-2/blob/25f5c755477efdcc8c4919324bcf450b86131222/MediaPortal/Source/Core/UPnP/Infrastructure/Dv/GENA/EventSubscription.cs#L213
When disposing the event subscription any pending requests are waited on to complete whilst the waiting thread holds a lock on _serverData.SyncObj here - https://github.com/MediaPortal/MediaPortal-2/blob/25f5c755477efdcc8c4919324bcf450b86131222/MediaPortal/Source/Core/UPnP/Infrastructure/Dv/GENA/EventSubscription.cs#L155
If the request thread is currently in a callback and is itself waiting to obtain _serverData.SyncObj then a deadlock will occur, e.g. here - https://github.com/MediaPortal/MediaPortal-2/blob/25f5c755477efdcc8c4919324bcf450b86131222/MediaPortal/Source/Core/UPnP/Infrastructure/Dv/GENA/EventSubscription.cs#L213