Update imageprocessing to remove generated files.
Fix thread launch race condition.

Change-Id: I24d7f87ac87db6f9e3418d6a429471a71d2c9e9d
diff --git a/rsContext.cpp b/rsContext.cpp
index 629b481..e897d00 100644
--- a/rsContext.cpp
+++ b/rsContext.cpp
@@ -361,7 +361,7 @@
      Context *rsc = static_cast<Context *>(vrsc);
      uint32_t idx = (uint32_t)android_atomic_inc(&rsc->mWorkers.mLaunchCount);
 
-     LOGE("helperThreadProc 1 %p idx=%i", rsc, idx);
+     LOGV("RS helperThread starting %p idx=%i", rsc, idx);
 
      rsc->mWorkers.mLaunchSignals[idx].init();
      rsc->mWorkers.mNativeThreadId[idx] = gettid();
@@ -376,13 +376,13 @@
      while(rsc->mRunning) {
          rsc->mWorkers.mLaunchSignals[idx].wait();
          if (rsc->mWorkers.mLaunchCallback) {
-    LOGE("helperThreadProc 4");
             rsc->mWorkers.mLaunchCallback(rsc->mWorkers.mLaunchData, idx);
          }
-    LOGE("helperThreadProc 5");
          android_atomic_dec(&rsc->mWorkers.mRunningCount);
          rsc->mWorkers.mCompleteSignal.set();
      }
+
+     LOGV("RS helperThread exiting %p idx=%i", rsc, idx);
      return NULL;
 }
 
@@ -479,6 +479,10 @@
         LOGE("Failed to start rs context thread.");
         return;
     }
+    while(!mRunning) {
+        usleep(100);
+    }
+
     mWorkers.mRunningCount = 0;
     mWorkers.mLaunchCount = 0;
     for (uint32_t ct=0; ct < mWorkers.mCount; ct++) {
@@ -490,9 +494,6 @@
         }
     }
 
-    while(!mRunning) {
-        usleep(100);
-    }
 
     pthread_attr_destroy(&threadAttr);
 }