History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: QUARTZ-638
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: James House
Reporter: Gary Baker
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Quartz Scheduler

QuartzSchedulerThread.signaled should be marked with the volatile modifier or should be an AtomicBoolean

Created: 11/Dec/07 04:29 PM   Updated: 10/Apr/08 06:24 PM
Component/s: Core
Affects Version/s: 1.6
Fix Version/s: 1.6.1

Environment: all

Flags: Important


 Description  « Hide
read this for an explanation of why...

http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.3.1.4

"As described in §17, the Java programming language allows threads to access shared variables. As a rule, to ensure that shared variables are consistently and reliably updated, a thread should ensure that it has exclusive use of such variables by obtaining a lock that, conventionally, enforces mutual exclusion for those shared variables."

 All   Comments   Change History      Sort Order:
Henri Yandell - [15/Dec/07 02:14 PM ]
We're not 1.5 dependent (afaik), so it can't be AtomicBoolean.

Gary Baker - [15/Dec/07 02:44 PM ]
perhaps then it should be guarded by the scheduler object. i.e. put synchronized on the getter and setter

James House - [10/Apr/08 06:24 PM ]
Access to 'signaled' is now synchronized.

Though this 'practically' wasn't an issue, in that the 'signaled' flag is more of just a hint than anything, and if the true/false state of it was temporarily read incorrectly, it would not have any true adverse effect, but doing is expensive in terms of acquiring the lock -- which was justification as to why it wasn't synchronized before.


The reasons I went ahead and did so are that it does make intent more clear, and it actually is some prep work for changes necessary for the fix to QUARTZ-632.