diff options
author | Dan Nicholson <dbn.lists@gmail.com> | 2008-01-29 21:36:44 +0000 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2008-01-29 21:36:44 +0000 |
commit | 8189f4e999f8da778754d4aa7f77f92e0a526a4a (patch) | |
tree | 80576f9ede60ed6e7ff6b2b7e6cd3c0dffed38a8 /pm/functions | |
parent | 4b62a077eda4cf0055ca50225e50d7d581669d1c (diff) |
Earlier Victor and I discussed moving the sleep after the check in
spin_lock(). That got lost in the shuffle, so here's a new patch.
Diffstat (limited to 'pm/functions')
-rwxr-xr-x | pm/functions | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pm/functions b/pm/functions index c456779..05409fe 100755 --- a/pm/functions +++ b/pm/functions @@ -59,9 +59,9 @@ spin_lock() # $2 = optional timeout local elapsed=0 while ! try_lock $1; do - sleep 1; [ "x$2" != "x" ] && [ $(( $elapsed == $2 )) -ne 0 ] && return 1 elapsed=$(($elapsed + 1)) + sleep 1; done } |