+KeAcquireInStackQueuedSpinLock()
authorshort <>
Fri, 28 Mar 2003 20:16:27 +0000 (20:16 +0000)
committershort <>
Fri, 28 Mar 2003 20:16:27 +0000 (20:16 +0000)
+KeReleaseInStackQueuedSpinLock()

src/libcaptive/halcaptive/queuedspinlock.c

index 3b6d082..4b28185 100644 (file)
@@ -22,6 +22,7 @@
 /* no reactos prototype for KeAcquireQueuedSpinLock() and KeReleaseQueuedSpinLock() */
 #include "reactos/ddk/types.h" /* for KIRQL */
 #include "reactos/ddk/kefuncs.h"       /* for KeGetCurrentIrql() */
+#include <glib/gmessages.h>
 
 
 typedef enum _KSPIN_LOCK_QUEUE_NUMBER {
@@ -99,3 +100,52 @@ KIRQL KeAcquireQueuedSpinLockRaiseToSynch(IN KSPIN_LOCK_QUEUE_NUMBER Number)        /*
 
        return KeGetCurrentIrql();
 }
+
+
+typedef struct _KSPIN_LOCK_QUEUE {
+       struct _KSPIN_LOCK_QUEUE * volatile Next;
+       PKSPIN_LOCK volatile Lock;
+       } KSPIN_LOCK_QUEUE, *PKSPIN_LOCK_QUEUE;
+
+typedef struct _KLOCK_QUEUE_HANDLE {
+       KSPIN_LOCK_QUEUE LockQueue;
+       KIRQL OldIrql;
+       } KLOCK_QUEUE_HANDLE,*PKLOCK_QUEUE_HANDLE;
+
+
+/**
+ * KeAcquireInStackQueuedSpinLock:
+ * @SpinLock: Spin lock structure to acquire.
+ * %NULL value is forbidden.
+ * @LockHandle: Handle to later pass to KeReleaseInStackQueuedSpinLock().
+ * %NULL value is forbidden.
+ *
+ * Acquires a queued spinlock @SpinLock.
+ * You must not mix this call with KeAcquireQueuedSpinLock() for the same @SpinLock.
+ * Currently libcaptive doesn't use multithreading
+ * and thus this function is a NOP now. #GMutex would be needed otherwise.
+ */
+VOID KeAcquireInStackQueuedSpinLock(IN PKSPIN_LOCK SpinLock,IN PKLOCK_QUEUE_HANDLE LockHandle)
+{
+       g_return_if_fail(SpinLock!=NULL);
+       g_return_if_fail(LockHandle!=NULL);
+
+       /* TODO:thread */
+}
+
+
+/**
+ * KeReleaseInStackQueuedSpinLock:
+ * @LockHandle: Handle from the acquire by KeAcquireInStackQueuedSpinLock().
+ * %NULL value is forbidden.
+ *
+ * Releases a queued spinlock acquired by KeAcquireInStackQueuedSpinLock().
+ * Currently libcaptive doesn't use multithreading
+ * and thus this function is a NOP now. #GMutex would be needed otherwise.
+ */
+VOID KeReleaseInStackQueuedSpinLock(IN PKLOCK_QUEUE_HANDLE LockHandle)
+{
+       g_return_if_fail(LockHandle!=NULL);
+
+       /* TODO:thread */
+}