genericopenlibs/openenvcore/backend/inc/fdesc.h
branchRCL_3
changeset 56 acd3cd4aaceb
parent 54 4332f0f7be53
child 57 2efc27d87e1c
--- a/genericopenlibs/openenvcore/backend/inc/fdesc.h	Thu Aug 19 11:33:45 2010 +0300
+++ b/genericopenlibs/openenvcore/backend/inc/fdesc.h	Tue Aug 31 16:54:36 2010 +0300
@@ -22,7 +22,6 @@
 #define _FDESC_H
 
 #include <e32std.h>
-#include <e32atomics.h>
 #include <e32cons.h>
 #include <f32file.h>
 #include <es_sock.h>
@@ -65,22 +64,6 @@
 
 #endif //SYMBIAN_OE_LARGE_FILE_SUPPORT && !SYMBIAN_OE_NO_LFS
 
-// Atomic socket operations support
-
-#define ATOMICSOCKETOP(realcall,on_error) \
-    { \
-    if (__e32_atomic_tau_ord32((void *)&iCount, 0x8000, 0, 1) >= 0x8000) \
-        { \
-        on_error; \
-        } \
-    else \
-        { \
-        realcall; \
-        __e32_atomic_tas_ord32((void *)&iCount, 0, -1, 0); \
-        } \
-    }
-
-#define NOP 
 
 //Enumarations for Polling
 enum TPollMode
@@ -528,20 +511,10 @@
 		 iIoctlLock.Signal();
 		 return iSelectEvents();
 		 }
-	 
-	 inline TInt CreateLock() 
+	 inline int CreateLock() 
 		 {
-	     TInt err = iIoctlLock.CreateLocal(1) || iReadLock.CreateLocal() || iWriteLock.CreateLocal();
-	     if (err != KErrNone)
-	         {
-             // closes on unopened handles are safe
-             iIoctlLock.Close();
-             iReadLock.Close();
-             iWriteLock.Close();
-	         }
-	     return err;
+		 return (iIoctlLock.CreateLocal(1)|| iReadLock.CreateLocal() || iWriteLock.CreateLocal());
 		 }
-		 
 	 inline RSemaphore& GetIoctlLock()
 		 {
 		 return iIoctlLock;
@@ -558,9 +531,9 @@
 	 
 protected:
 		//rearrange these 
-	CSockDescBase():iAddrFamily(-1),iProtocol(KUndefinedProtocol),iIoctlFlag(EFalse),iCount(0)
+	CSockDescBase():iAddrFamily(-1),iProtocol(KUndefinedProtocol),iIoctlFlag(EFalse)
 	{
-	
+
 	}	
 	RSocket iSocket;
 	TSockXfrLength iLength;
@@ -572,10 +545,8 @@
 	// For preventing simultaneous ioctl calls.
 	// No native support.
 	RSemaphore iIoctlLock;
-	// Is this required?
 	TBool iIoctlFlag;
-	// Safeguard against issue of a second Read/Write request while the first is pending.
-	// The iReadLock also guards OpenUsingPreference
+	
 	//For locking the descriptor before any operation.
 	//To make it thread safe.
 	RFastLock iReadLock;
@@ -584,7 +555,6 @@
 	//Flag to mark the connect status of a non-blocking socket as "in progress"
 	//to prevent duplicate connection request
 	TBool iConnectInProgress;
-	volatile TInt iCount;
 protected:
 
 	inline TInt isStream() const	// inline, but private
@@ -689,22 +659,6 @@
 	TInt GetInterfaceDetails( void *aParam ,TInt aFlag, TInt aType );
 	TInt SetInterafceParamInfo( void *aParam,TInt aType);
 	TInt SetInterfaceDetails( void *aParam ,TInt aFlag, TInt aType );
-	
-	TInt maybe_reopen_socket()
-	    {
-	    TInt err = KErrNone;
-	    if (!__e32_atomic_load_acq32(&iSocketPtr))
-	        {
-            iReadLock.Wait();
-            if (!iSocketPtr)
-                {
-                err = OpenUsingPreference();
-                }
-            iReadLock.Signal();
-	        }
-	    return err;
-	    }
-	
 	enum InterfaceType
 		{
 		EACCESS_POINT,