Implement shared semantics checks for correct use of XNU functions for shared and exclusive mutexes.
Clarification:
Shared semantics says that if a lock has been acquired as shared, so it shall be released as shared as well. And vice versa, unique(usual) acquisition shall be followed by a unique unlock. This produces so-called pairs "shared-shared" and "unique-unique" Any mixed sequences of "shared-unique" or "unique-shared" are ill-formed and can lead to undefined behavior.
In particular affected functions lck_rw_lock_shared and lck_rw_unlock_shared are guided by documentaion here
https://developer.apple.com/library/archive/documentation/Darwin/Conceptual/KernelProgramming/synchronization/synchronization.html#//apple_ref/doc/uid/TP30000905-CH218-BABCHEIA
Quote: "You should always be careful when using these functions, as unlocking a lock held in shared mode using an exclusive call or vice-versa will lead to undefined results."