Use sx_sleep() when waiting for a file lock instead of explicitly dropping the sx lock and then doing a tsleep() without a timeout.  The tsleep() method leads to lost wakeups that can cause processes to hang waiting for a lock on an unlocked file.  The lockf code already uses sx_sleep() in 7.x+.
Use sx_sleep() when waiting for a file lock instead of explicitly dropping
the sx lock and then doing a tsleep() without a timeout.  The tsleep()
method leads to lost wakeups that can cause processes to hang waiting for
a lock on an unlocked file.  The lockf code already uses sx_sleep() in
7.x+.

jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase