userlibandfileserver/fileserver/shostmassstorage/server/controller/include/cusbhostmsdevicethread.h
changeset 31 56f325a607ea
parent 0 a41df078684a
--- a/userlibandfileserver/fileserver/shostmassstorage/server/controller/include/cusbhostmsdevicethread.h	Mon Dec 21 16:14:42 2009 +0000
+++ b/userlibandfileserver/fileserver/shostmassstorage/server/controller/include/cusbhostmsdevicethread.h	Wed Dec 23 11:43:31 2009 +0000
@@ -47,35 +47,49 @@
 	CUsbHostMsLogicalUnit& iLu;
     };
 
+class CUsbHostMsSession;
 
 class CUsbHostMsDeviceThread : public CActive
     {
 public:
     static const TInt KMaxNumMessage = 32;
 
+	static CUsbHostMsDeviceThread* NewL(CUsbHostMsSession& aUsbHostMsSession, TUint aToken);
+	~CUsbHostMsDeviceThread();
+
+private:
+    CUsbHostMsDeviceThread(CUsbHostMsSession& aUsbHostMsSession, TUint aToken);
+
+public:
 	static TInt Entry(TAny* aPtr);
+	TInt QueueMsg(const RMessage2& aMsg);
+    void Lock();
+    void Unlock();
+
+
+private:
+    void Start();
+
 	void RunL();
-	inline void DoCancel()	{	};
-	void Lock();
-	void Unlock();
-	TInt QueueMsg(const RMessage2& aMsg);
+	void DoCancel();
+    TInt RunError(TInt aError);
+
 	void HandleMessage(const RMessage2& aMessage);
-	static CUsbHostMsDeviceThread* NewL(TUint aToken);
+
 	void UnRegisterInterfaceL(const RMessage2& aMessage);
-	~CUsbHostMsDeviceThread();
+
 private:
     static void DoStartServerL(TAny* aPtr);
-	CUsbHostMsDeviceThread(TUint);
+
 	void RegisterInterfaceL(const RMessage2& aMessage);
 	void InitialiseInterfaceL(const RMessage2& aMessage);
 	void GetNumLunL(const RMessage2& aMessage);
 	void RegisterLogicalUnitL(const RMessage2& aMessage);
 	TInt Shutdown();
 
-public:
-	TBool iIsSignalled;
+private:
+    CUsbHostMsSession& iUsbHostMsSession;
 
-private:
 	CUsbHostMsDevice* iUsbHostMsDevice;
 
 	RMessage2 iRMessage2[KMaxNumMessage];
@@ -86,4 +100,17 @@
 	TBool iQueueFull;
     };
 
+
+inline void CUsbHostMsDeviceThread::Lock()
+	{
+	iMutex.Wait();
+	}
+
+
+inline void CUsbHostMsDeviceThread::Unlock()
+	{
+	iMutex.Signal();
+	}
+
+
 #endif // CUSBMASSSTORAGEDEVICETHREAD_H