Is there a way to lock on a unsafe unmanaged struct in C#? I tried to implement a pattern similar to C with semaphores but C# has only managed Semaphores that cannot be used in