TSharedPtr is invalid in FRunnable

In an FRunnable, I have a thread-safe TSharedPtr that contains a struct upon which I perform a bunch of math. I try to set that TSharedPtr from an actor in game.

My actor performs various checks on its copy of the TSharedPtr to make sure it’s ready to go, including an IsValid() check. If the TSharedPtr is valid, it calls a function on the FRunnable that sets the pointer. This function in the FRunnable also runs its own check to see if the TSharedPtr is valid, then assigns it to it’s TSharedPtr variable.

My problem is that both my actor and my FRunnable claim the TSharedPtr is valid upon assignment. However, when I check in the FRunnable’s Run() function if the pointer is valid, it claims that it is invalid.

I’m curious why that is, and how to fix it?

Are you using "TSharedPtr < T, ESPMode::ThreadSafe > " ?