This repository was archived by the owner on Oct 18, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-15
lines changed
android-tree-sitter/src/main/java/com/itsaky/androidide/treesitter Expand file tree Collapse file tree 1 file changed +4
-15
lines changed Original file line number Diff line number Diff line change 2929 */
3030public class TSParser extends TSNativeObject {
3131
32- protected final ReentrantLock parseLock = new ReentrantLock (true );
33- protected final ReentrantLock cancellationLock = new ReentrantLock (true );
32+ protected final ReentrantLock parseLock = new ReentrantLock ();
3433 protected final AtomicBoolean isParsing = new AtomicBoolean (false );
3534 protected final AtomicBoolean isCancellationRequested = new AtomicBoolean (false );
3635
@@ -257,22 +256,12 @@ public boolean requestCancellation() {
257256 return requested ;
258257 }
259258
260- protected void setCancellationRequested (boolean isRequested ) {
261- cancellationLock .lock ();
262- try {
263- this .isCancellationRequested .set (isRequested );
264- } finally {
265- cancellationLock .unlock ();
266- }
259+ protected synchronized void setCancellationRequested (boolean isRequested ) {
260+ this .isCancellationRequested .set (isRequested );
267261 }
268262
269263 protected synchronized boolean isCancellationRequested () {
270- cancellationLock .lock ();
271- try {
272- return this .isCancellationRequested .get ();
273- } finally {
274- cancellationLock .unlock ();
275- }
264+ return this .isCancellationRequested .get ();
276265 }
277266
278267 /**
You can’t perform that action at this time.
0 commit comments