eprst / KTodo

Simple todo manager for Android inspired by the one we had in PalmOS
5 stars 2 forks source link

UpdateService Race Condition #3

Open powerofpi opened 11 years ago

powerofpi commented 11 years ago

There is a subtle race condition in UpdateService.

As soon as the alarm is set on 107, there is a race between the current thread entering its synchronized block first (and executing 110) and the new thread entering its synchronized block (and evaluating the condition on line 60).

Currently, you get lucky and avoid the issue by virtue of scheduling the alarm far into the future. However, if you shorten the time until the next update, this race will be increasingly exposed.

eprst commented 11 years ago

thanks, I'll take a look On Dec 30, 2012 6:06 PM, "powerofpi" notifications@github.com wrote:

There is a subtle race condition in UpdateService.

As soon as the alarm is set on 107, there is a race between the current thread entering its synchronized block first (and executing 110) and the new thread entering its synchronized block (and evaluating the condition on line 60).

Currently, you get lucky and avoid the issue by virtue of scheduling the alarm far into the future. However, if you shorten the time until the next update, this race will be increasingly exposed.

— Reply to this email directly or view it on GitHubhttps://github.com/eprst/KTodo/issues/3.