The locking functions here are used by code in class.c and metadata.c to lock access to the shared hashtables inside the MonoImage
This is the low-level API for accessing the metadata images.