Semaphore in a function

In reply to dave_59:

The common resource is an associative array used to track the id’s in use. Id’s gets pushed into this from a function which gets queried from sequences when generating the stimulus to push the id and from the uvm write function which is for output transaction to determine, when the id has come out of DUT (or no more active).