Using sx instead of rw locks