mirror of
https://github.com/mik3y/usb-serial-for-android
synced 2025-06-07 16:06:10 +00:00
really set thread priority in SerialInputOutputManager (#349)
This commit is contained in:
parent
cbed086279
commit
c06ccf70bc
@ -167,18 +167,16 @@ public class SerialInputOutputManager implements Runnable {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if(mThreadPriority != Process.THREAD_PRIORITY_DEFAULT)
|
|
||||||
setThreadPriority(mThreadPriority);
|
|
||||||
|
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
if (getState() != State.STOPPED) {
|
if (getState() != State.STOPPED) {
|
||||||
throw new IllegalStateException("Already running");
|
throw new IllegalStateException("Already running");
|
||||||
}
|
}
|
||||||
mState = State.RUNNING;
|
mState = State.RUNNING;
|
||||||
}
|
}
|
||||||
|
|
||||||
Log.i(TAG, "Running ...");
|
Log.i(TAG, "Running ...");
|
||||||
try {
|
try {
|
||||||
|
if(mThreadPriority != Process.THREAD_PRIORITY_DEFAULT)
|
||||||
|
Process.setThreadPriority(mThreadPriority);
|
||||||
while (true) {
|
while (true) {
|
||||||
if (getState() != State.RUNNING) {
|
if (getState() != State.RUNNING) {
|
||||||
Log.i(TAG, "Stopping mState=" + getState());
|
Log.i(TAG, "Stopping mState=" + getState());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user