Race condition in AsyncCommandInvoker + patch
Project: | JNode Core |
Component: | Code |
Category: | bug report |
Priority: | normal |
Assigned: | Unassigned |
Status: | closed |
Jump to:
Description
I've discovered a bug in the way that AsyncCommandInvoker synchronizes with the thread that is launched to run a command. This bug shows up when I run a command via ShellEmu running from Eclipse (and a Sun JDK). Approximately one time in three, the command runs but control never returns to the ShellEmu command prompt.
I haven't observed this behavior when running a regular CommandShell in JNode. It seems that the thread scheduler in JNode has more predictable behavior.
A bug fix is attached. It simply moves the sync setup code to before the start() call on the command runner thread. That way it works even if the start() call implicitly yields to the runner thread ... as seems to happen sometimes on Sun JVMs.
Attachment | Size |
---|---|
issues_114 | 835 bytes |
- Login to post comments
#1
Patch committed.