Implement java interface for RS shutdown and fix shutdown deadlock with the command fifo.
diff --git a/rsLocklessFifo.h b/rsLocklessFifo.h
index abeddf7..d0a4356 100644
--- a/rsLocklessFifo.h
+++ b/rsLocklessFifo.h
@@ -25,13 +25,14 @@
 
 // A simple FIFO to be used as a producer / consumer between two
 // threads.  One is writer and one is reader.  The common cases
-// will not require locking.  It is not threadsafe for multiple 
+// will not require locking.  It is not threadsafe for multiple
 // readers or writers by design.
 
-class LocklessCommandFifo 
+class LocklessCommandFifo
 {
 public:
     bool init(uint32_t size);
+    void shutdown();
 
     LocklessCommandFifo();
     ~LocklessCommandFifo();
@@ -59,6 +60,7 @@
     uint8_t * mBuffer;
     uint8_t * mEnd;
     uint8_t mSize;
+    bool mInShutdown;
 
     Signal mSignalToWorker;
     Signal mSignalToControl;