Menu

#6 java threads

open
code (5)
5
2011-05-17
2011-05-17
RWZ
No

I am creating a java based parser and want to run it as a thread so the GUI doesn't stall, but in case of an error I want to be able to stop/kill the parser thread. Thread.stop() is deprecated and the "official" solution is to poll a boolean volatile flag BUT I have no direct access to the yyparse() method. I could put the check in yylex(), return a special token and write a user action that does a return (from yyparse) but that seems like an ugly hack. Since the heart of yyparse() is just a while(true){} loop an ideal, clean solution would be to make the while() check the flag but that requires changing source code :-(

Am I missing something really obvious?

Discussion


Log in to post a comment.