Skip to content

Commit 95a4127

Browse files
committed
Convert field to getter
1 parent 1fb9fd9 commit 95a4127

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/main/java/org/usb4java/javax/AbstractIrpQueue.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ abstract class AbstractIrpQueue<T extends UsbIrp>
3434
private volatile Thread processor;
3535

3636
/** If queue is currently aborting. */
37-
protected volatile boolean aborting;
37+
private volatile boolean aborting;
3838

3939
/** The USB device. */
4040
private final AbstractDevice device;
@@ -237,5 +237,15 @@ protected final void processControlIrp(final UsbControlIrp irp)
237237
{
238238
throw new UsbShortPacketException();
239239
}
240-
}
240+
}
241+
242+
/**
243+
* Checks if this queue is currently aborting.
244+
*
245+
* @return True if queue is aborting, false if not.
246+
*/
247+
protected final boolean isAborting()
248+
{
249+
return this.aborting;
250+
}
241251
}

src/main/java/org/usb4java/javax/IrpQueue.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ private int transfer(final DeviceHandle handle,
201201
result = LibUsb.bulkTransfer(handle, address, buffer,
202202
transferred, timeout);
203203
}
204-
while (in && result == LibUsb.ERROR_TIMEOUT && !this.aborting);
204+
while (in && result == LibUsb.ERROR_TIMEOUT && !isAborting());
205205
if (result < 0)
206206
{
207207
throw new LibUsbException(
@@ -215,7 +215,7 @@ else if (type == UsbConst.ENDPOINT_TYPE_INTERRUPT)
215215
result = LibUsb.interruptTransfer(handle, address, buffer,
216216
transferred, timeout);
217217
}
218-
while (in && result == LibUsb.ERROR_TIMEOUT && !this.aborting);
218+
while (in && result == LibUsb.ERROR_TIMEOUT && !isAborting());
219219
if (result < 0)
220220
{
221221
throw new LibUsbException(

0 commit comments

Comments
 (0)