Fix accessing another thread's resources