SynchronizationLockException: Object has not been locked by this thread

Hi!

We shipped our game with this wonderful A* asset, it has helped out a bunch thanks!

However, some players are now experiencing this bug, all of the players are running IL2CPP:

SynchronizationLockException: Object has not been locked by this thread.
Pathfinding.ThreadControlQueue.Pop () (at <00000000000000000000000000000000>:0)

Managed Stack Trace:

Pathfinding.ThreadControlQueue.Pop () (at <00000000000000000000000000000000>:0)
Pathfinding.PathProcessor.CalculatePathsThreaded (Pathfinding.PathHandler pathHandler) (at <00000000000000000000000000000000>:0)
VUskhhGiFgeLMdvetIWfLHUHeIkm+metgOqdnKkAQPGJqkHzqJugIBtqD.Invoke () (at <00000000000000000000000000000000>:0)
System.Action`1[T].Invoke (T obj) (at <00000000000000000000000000000000>:0)
System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <00000000000000000000000000000000>:0)
System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) (at <00000000000000000000000000000000>:0)
VUskhhGiFgeLMdvetIWfLHUHeIkm+metgOqdnKkAQPGJqkHzqJugIBtqD.Invoke () (at <00000000000000000000000000000000>:0)
UnityEngine.Debug:LogException(Exception)
Pathfinding.PathProcessor:CalculatePathsThreaded(PathHandler)
metgOqdnKkAQPGJqkHzqJugIBtqD:Invoke()
System.Threading.ExecutionContext:Run(ExecutionContext, ContextCallback, Object)
metgOqdnKkAQPGJqkHzqJugIBtqD:Invoke()

It happens when we clean up and destroy objects including the A* prefab before returning to the title screen. The only log we get before this error occurs is:

Could not terminate pathfinding thread[0] in 200ms, trying Thread.Abort

Any thoughts? :slight_smile:

Hi

Hm… weird. I think this has been fixed in the beta version though. At least a related exception has been fixed.

1 Like

Hey I am still getting those exceptions, in pathfinding 4.3.61

Pathfinding.ThreadControlQueue.Pop () (at <00000000000000000000000000000000>:0)
Pathfinding.PathProcessor.CalculatePathsThreaded (Pathfinding.PathHandler pathHandler) (at <00000000000000000000000000000000>:0)
System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <00000000000000000000000000000000>:0)
Pathfinding.PathProcessor:CalculatePathsThreaded(PathHandler)
System.Threading.ExecutionContext:RunInternal(ExecutionContext, ContextCallback, Object, Boolean)


PS: sorry didn’t notice before that the guy above me posted for recast graph, this is happening to me on grid graph.

Can you replicate this exception reliably?