RuntimeContext is a wrapper around RoInitialize and RoUninitialize, which initialize (and uninitialize) the WinRT runtime per thread.
Calling RoUninitialize from a different thread than RoInitialize is not allowed.
To fix this, we can replace the inner () with PhantomData<*mut ()>, which is also a zero-size type and (by virtue of containing a pointer) is not automatically Send and Sync. In the future (i.e. when more stuff is stablized), we can explicitly do impl !Send for RuntimeContext.
RuntimeContextis a wrapper aroundRoInitializeandRoUninitialize, which initialize (and uninitialize) the WinRT runtime per thread.Calling
RoUninitializefrom a different thread thanRoInitializeis not allowed.To fix this, we can replace the inner
()withPhantomData<*mut ()>, which is also a zero-size type and (by virtue of containing a pointer) is not automaticallySendandSync. In the future (i.e. when more stuff is stablized), we can explicitly doimpl !Send for RuntimeContext.