File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
src/org/opensolaris/opengrok/analysis Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change 39
39
import org .opensolaris .opengrok .util .IOUtils ;
40
40
41
41
/**
42
- * Provides Ctags by having a running instance of ctags
42
+ * Provides Ctags by having a running subprocess of ctags.
43
43
*
44
44
* @author Chandan
45
45
*/
@@ -53,8 +53,8 @@ public class Ctags {
53
53
private volatile boolean closing ;
54
54
private volatile boolean signalled ;
55
55
private Process ctags ;
56
- Thread errThread ;
57
- Thread outThread ;
56
+ private Thread errThread ;
57
+ private Thread outThread ;
58
58
private OutputStreamWriter ctagsIn ;
59
59
private BufferedReader ctagsOut ;
60
60
private static final String CTAGS_FILTER_TERMINATOR = "__ctags_done_with_file__" ;
@@ -65,8 +65,15 @@ public class Ctags {
65
65
66
66
private boolean junit_testing = false ;
67
67
68
+ /**
69
+ * Gets a value indicating if a subprocess of ctags was started and either:
70
+ * 1) it is not alive; or 2) any necessary supporting thread is not alive.
71
+ * @return {@code true} if the instance should be considered closed and no
72
+ * longer usable.
73
+ */
68
74
public boolean isClosed () {
69
- return ctags != null && !ctags .isAlive ();
75
+ return ctags != null && (!ctags .isAlive () || outThread == null ||
76
+ !outThread .isAlive ());
70
77
}
71
78
72
79
public String getBinary () {
You can’t perform that action at this time.
0 commit comments