Well it matters!
Typically lock is detected by sensing the pulse width of the up and down signals and if they are too narrow than a set limit for a sufficiently long time phase lock is declared. For a fractional-N pll, due to the contant phase deviations, this window has to be larger than that set for an integer pll.
hmsheng, You could OR the UP and DN signals and use that signal to select a discharge path for a capacitor that is being fed by a constant current that is a ratio of the discharge current. I hope you get the idea at the first level.
Or digitally detect whether the signal is shorter than the propagation delays of a few gates for both UP and DN and declare the lock.