The blocking semantics of close module described in the project handout are wrong. Closing a module should not be a blocking operation.
You should keep a reference count for each loaded module in the OML. When the value of the count goes to zero, the module is no longer in use and can be deleted from the system (and its memory freed). Modules reference counts should be incremented when the module is loaded, or when a process that uses the module is started. The count is decremented when a process that has an open module terminates, or when Close_module is called. Processes can have more than one open module at a time.