Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0f6534b6 authored by Jorge Ruesga's avatar Jorge Ruesga
Browse files

CMFM: Fix sync object



Change-Id: I32db52a17fa1c0a3f31010e16b5cf2a697be7f6d
Signed-off-by: default avatarjruesga <jorge@ruesga.com>
parent dd954c7d
Loading
Loading
Loading
Loading
+6 −10
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ public abstract class AsyncResultProgram
     * @hide
     */
    final List<Byte> mPartialDataType;
    private final Object mSync = new Object();
    final Object mSync = new Object();
    /**
     * @hide
     */
@@ -106,7 +106,7 @@ public abstract class AsyncResultProgram
     * @hide
     */
    public final void onRequestStartParsePartialResult() {
        this.mWorkerThread = new AsyncResultProgramThread(this.mSync);
        this.mWorkerThread = new AsyncResultProgramThread();
        this.mWorkerThread.start();

        //Notify start to command class
@@ -132,7 +132,7 @@ public abstract class AsyncResultProgram
        }
        synchronized (this.mTerminateSync) {
            try {
                this.mSync.wait();
                this.mTerminateSync.wait();
            } catch (Exception e) {
                /**NON BLOCK**/
            }
@@ -353,16 +353,12 @@ public abstract class AsyncResultProgram
     */
    private class AsyncResultProgramThread extends Thread {
        boolean mAlive = true;
        private final Object mSyncObj;

        /**
         * Constructor of <code>AsyncResultProgramThread</code>.
         *
         * @param sync The synchronized object
         */
        AsyncResultProgramThread(Object sync) {
        AsyncResultProgramThread() {
            super();
            this.mSyncObj = sync;
        }

        /**
@@ -373,8 +369,8 @@ public abstract class AsyncResultProgram
            try {
                this.mAlive = true;
                while (this.mAlive) {
                   synchronized (this.mSyncObj) {
                       this.mSyncObj.wait();
                   synchronized (AsyncResultProgram.this.mSync) {
                       AsyncResultProgram.this.mSync.wait();
                       while (AsyncResultProgram.this.mPartialData.size() > 0) {
                           if (!this.mAlive) {
                               return;