fixed some issues introduced when switching from mutexes to spinlocks

there is still a bug hiding there which is triggered 'sometimes' by high parallelism ...
I'm working on it ... must be a race condition introduced when changing the logic to fit
the use of spinlocks instead of a recursive mutex