Reading /usr/bin/xflock4 you'll see that the script first checks if xscreensaver or gnome-screensaver are running.
If neither of these are running the script will try to run xlock and then maybe slock.
My 12.04.3 system has been upgraded over the years. In the past I had to edit xflock4 because it wasn't properly detecting if xsreensaver or gnome-screensaver was running.
Early versions used "pgrep xscreensaver". This didn't work properly so I needed to use "ps aux | x[s]creensaver" to detect xscreensaver for instance.
Today my script just has a #comment stating it checks if xscreensaver or gnome-screensaver is running. Not sure if an upgrade to 12.04 out this in place or I took if from a system higher than 12.04.