code: private HANDLE lockMutex() throws IOException {
      PointerByReference securityDescriptor = new PointerByReference();
      Advapi32.INSTANCE
          .ConvertStringSecurityDescriptorToSecurityDescriptor(EVERYONE_SYNCHRONIZE_SDDL, 1,
              securityDescriptor, null);
      Advapi32.SECURITY_ATTRIBUTES sa = new Advapi32.SECURITY_ATTRIBUTES();
      sa.nLength = sa.size();
      sa.lpSecurityDescriptor = securityDescriptor.getValue();
      sa.bInheritHandle = false;
      HANDLE mutex = Kernel32.INSTANCE.CreateMutex(sa, false, memoryName + "_CONNECT_MUTEX");
      Kernel32.INSTANCE.LocalFree(securityDescriptor.getValue());
      if (Kernel32.INSTANCE.WaitForSingleObject(mutex, timeout) == -1) {
        Kernel32.INSTANCE.CloseHandle(mutex);
        throw new IOException(
            "wait failed (timeout, last error =  " + Kernel32.INSTANCE.GetLastError());
      }
      return mutex;
    }
docs: /*
  Create a mutex to synchronize login. Without mutex, different connections that are created at about the same
  time, could get the same connection number. Note, that this mutex, or any synchronization does not exist in
  in either C or .NET connectors (i.e they are racy)