xapi-project/xen-api — pull request #1574 by johnelse (2013-12-02 16:04:44+00:00)
Title: CA-123007: Hold a mutex inside Device.PCI.unbind_from_nvidia

If multiple threads are trying to unbind different devices in parallel,
there is a chance that some of the nodes under /proc/driver/nvidia/ will
disappear after a thread has retrieved the list of nodes but before that
thread has accessed their contents.

Holding a mutex for the duration of the (find device,lock device,unbind)
sequence means this should no longer happen.