The name and description of this function imply that it is computing and returning a single value.  I know this is somewhat clarified in the return comment, but that is misleading as well: this function also returns the global lock length.  I think this function should be renamed to something more clear and either the return changed or the doc updated.