worker lock: consider that multi thereads use same file lock
authorjihye424.kim <jihye424.kim@samsung.com>
Mon, 21 Dec 2015 07:24:07 +0000 (16:24 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Tue, 22 Dec 2015 04:50:41 +0000 (13:50 +0900)
commit469ff6425428d99f63064231969483b76af801be
tree225c12acf6e71b705c7e9069049fc3a80576afb2
parent7b0fa3026499f65a74d98da4ed31ccd795d36f9c
worker lock: consider that multi thereads use same file lock

- worker lock: use lock file to prevent conflict between emulator manager processes (ui and cli)
- 'create base image' job  will take long time(30 ~ 60 seconds), so spearate this job to other thread
- problem1: this job has lock file during long time, other job will be wait...
--> use property-name.lock file for this job
--> release worker lock after to create property-name.lock file
- problem2: if multi threads use same lock file,
  java throw OverlappingFileLockException when already locked file by other thread (by same JVM)
-> wait for release lock

Change-Id: I1cb43ff3631be005208d86979c837032d6029fd8
Signed-off-by: jihye424.kim <jihye424.kim@samsung.com>
src/org/tizen/emulator/manager/vms/VMWorkerCommon.java
src/org/tizen/emulator/manager/vms/helper/WorkerLock.java