]> code.ossystems Code Review - openembedded-core.git/commit
scripts/runqemu-internal: Fix lock races
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 20 Mar 2013 22:58:30 +0000 (22:58 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 27 Mar 2013 17:25:05 +0000 (17:25 +0000)
commitf1a126f2b0f419b2de573e2367d41d8ccc28b346
tree7a43c60a6b93c86137e36c85146848b5588141cd
parent22a54741167dd6cc011a1b98787c82cc992158ed
scripts/runqemu-internal: Fix lock races

There are two problems here. Firstly the grep command is unanchored so
pid 345 will match against 12345 and so on.

The second issue is that there are several context switched between attempting
the lock and then writing the pid to it.

Between the two issues, there were issues appearing on the autobuilder due
to these conflicts. This patch replaces the mechanism with flock on fd 8
which should be a safer mechanism to use.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/runqemu-internal