My patch does this (as I mentioned in my reply to Juri); it also does what
you ask, although without the standard file-lock mechanism. A separate
lock file is maintained which identifies (by PID) the owner of the desktop
file. Then the second Emacs will see the file and complain about it
(regardless of the setting of `desktop-save-mode', for the reasons of
no-precognition mentioned above), although the user is allowed the option
of proceeding anyway (at which point it's up to the modification dates to
attempt a peaceful resolution later).