osutil: change locking mechanism
authorSeokYeon Hwang <syeon.hwang@samsung.com>
Wed, 6 Jan 2016 10:00:49 +0000 (19:00 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Tue, 26 Jan 2016 07:04:19 +0000 (16:04 +0900)
commita1d119b70e8fa17a34d8d024ac543f7adeb24561
tree0916ec5a252208e09d766cc9a15d1e5494a13cb2
parentcd433418a715611ea692db3432458a67d962b15e
osutil: change locking mechanism

Using file lock mechanism instead of shared memory. Emulator-manager
can share same file lock for checking whether same VM is running or not.

On Linux and MacOSX, POSIX file lock is used. If it is failed to lock file
and the file is not locked with valid type and record, it will try again to
lock file after sleeping.

On Windows, emulator will stop before checking lock because platform
image file and kernel log file are aleady opened with exclusive write
lock by pre-executed emulator. But it is still useful for
emulator-manager.

In addition, header files are cleaned up.

Change-Id: Ibedfac3503fb0d19956a7fbed6736337be8f2223
Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
Signed-off-by: Sangho Park <sangho.p@samsung.com>
tizen/src/util/osutil-darwin.c
tizen/src/util/osutil-linux.c
tizen/src/util/osutil-win32.c
tizen/src/util/osutil.c
tizen/src/util/osutil.h