kernel/eka/euser/epoc/x86/uc_utl.cia
changeset 201 43365a9b78a3
parent 0 a41df078684a
child 257 3e88ff8f41d5
--- a/kernel/eka/euser/epoc/x86/uc_utl.cia	Wed Jun 23 19:44:53 2010 +0300
+++ b/kernel/eka/euser/epoc/x86/uc_utl.cia	Tue Jul 06 15:50:07 2010 +0300
@@ -42,6 +42,22 @@
 	THISCALL_EPILOG0()
 	}
 
+EXPORT_C __NAKED__ TInt RFastLock::Poll()
+	{
+	THISCALL_PROLOG0()
+	asm("xor eax, eax ");
+	asm("xor edx, edx ");
+	asm("dec edx ");
+
+	/* if ([ecx+4]==0) { [ecx+4]=-1; ZF=1;} else {eax=[ecx+4]; ZF=0;} */
+	asm("lock cmpxchg [ecx+4], edx ");
+	asm("jz short fastlock_poll_done ");
+	asm("mov eax, %0": : "i"(KErrTimedOut));
+
+	asm("fastlock_poll_done: ");
+	THISCALL_EPILOG0()
+	}
+
 EXPORT_C __NAKED__ void RFastLock::Signal()
 	{
 	THISCALL_PROLOG0()