friendica/friendica — pull request #374 by fermionic (2012-07-05 20:36:20+00:00)
Title: Prevent fcontact race conditions

This pull implements a basic locking capability on Friendica functions. The need for this arose when it because clear that when a new Diaspora contact was added to the `fcontact` table, the `find_diaspora_person_by_handle` function could run several times before the table was updated from the first run, resulting in duplicates of the contact entry. The locking prevents this from happening.

Also, the `find_diaspora_person_by_handle` function will no longer fail if a contact's info is in the `fcontact` table and it's time to refresh the contact, but the refresh fails. In that case, the old info will continue to be used.