Author: fireball
Date: Sun Mar 29 16:57:58 2009
New Revision: 40284
URL:
http://svn.reactos.org/svn/reactos?rev=40284&view=rev
Log:
- Implement KeTestSpinLock.
Modified:
trunk/reactos/include/ddk/winddk.h
trunk/reactos/ntoskrnl/ke/spinlock.c
Modified: trunk/reactos/include/ddk/winddk.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/winddk.h?rev=4…
==============================================================================
--- trunk/reactos/include/ddk/winddk.h [iso-8859-1] (original)
+++ trunk/reactos/include/ddk/winddk.h [iso-8859-1] Sun Mar 29 16:57:58 2009
@@ -5791,6 +5791,13 @@
IN OUT PKSPIN_LOCK SpinLock
);
+NTKERNELAPI
+BOOLEAN
+FASTCALL
+KeTestSpinLock(
+ IN PKSPIN_LOCK SpinLock
+);
+
#if defined (_X86_)
NTKERNELAPI
Modified: trunk/reactos/ntoskrnl/ke/spinlock.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/spinlock.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/spinlock.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/spinlock.c [iso-8859-1] Sun Mar 29 16:57:58 2009
@@ -305,14 +305,24 @@
}
/*
- * @unimplemented
+ * @implemented
*/
BOOLEAN
FASTCALL
KeTestSpinLock(IN PKSPIN_LOCK SpinLock)
{
- UNIMPLEMENTED;
- return FALSE;
+ /* Test this spinlock */
+ if (*SpinLock)
+ {
+ /* Spinlock is busy, yield execution */
+ YieldProcessor();
+
+ /* Return busy flag */
+ return FALSE;
+ }
+
+ /* Spinlock appears to be free */
+ return TRUE;
}
/* EOF */