commit | 06e57b5d46c87e9dd7bca1386b63b3a8522f51ef | [log] [tgz] |
---|---|---|
author | Jozef BABJAK <jozef.babjak@ixonos.com> | Thu Jan 20 08:09:25 2011 +0100 |
committer | Jozef BABJAK <jozef.babjak@ixonos.com> | Tue Feb 01 08:53:52 2011 +0100 |
tree | 3ae0da78524f8126167ed1e0c64314ec71141075 | |
parent | 056340ac95f233090990d77266d89aad3b60f913 [diff] |
Fixing possible race condition. That return statement is effectively a reading of asynchronously modified field. The reading and writing is elsewhere protected by locking on thread instance, except this one occurence. Moving 'return' statement into synchronized block ensures that it reads updated value. Don't be afraid of deadlock - wait() releases the lock and acquires it back when notified. Change-Id: I940c24c04a1a2d4508d14d11b6174ff4fb2ab7d5