Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

181 lines
2.5 KiB

  1. /*++
  2. Copyright (c) 2000 Microsoft Corporation
  3. Module Name:
  4. fmutexc.c
  5. Abstract:
  6. This module implements the code necessary to acquire and release fast
  7. mutexes.
  8. Author:
  9. David N. Cutler (davec) 23-Jun-2000
  10. Environment:
  11. Any mode.
  12. Revision History:
  13. --*/
  14. #include "exp.h"
  15. #if !defined (_X86_)
  16. #undef ExAcquireFastMutex
  17. VOID
  18. ExAcquireFastMutex (
  19. IN PFAST_MUTEX FastMutex
  20. )
  21. /*++
  22. Routine Description:
  23. This function acquires ownership of a fast mutex and raises IRQL to
  24. APC Level.
  25. Arguments:
  26. FastMutex - Supplies a pointer to a fast mutex.
  27. Return Value:
  28. None.
  29. --*/
  30. {
  31. xxAcquireFastMutex(FastMutex);
  32. return;
  33. }
  34. #undef ExReleaseFastMutex
  35. VOID
  36. ExReleaseFastMutex (
  37. IN PFAST_MUTEX FastMutex
  38. )
  39. /*++
  40. Routine Description:
  41. This function releases ownership to a fast mutex and lowers IRQL to
  42. its previous level.
  43. Arguments:
  44. FastMutex - Supplies a pointer to a fast mutex.
  45. Return Value:
  46. None.
  47. --*/
  48. {
  49. xxReleaseFastMutex(FastMutex);
  50. return;
  51. }
  52. #undef ExTryToAcquireFastMutex
  53. BOOLEAN
  54. ExTryToAcquireFastMutex (
  55. IN PFAST_MUTEX FastMutex
  56. )
  57. /*++
  58. Routine Description:
  59. This function attempts to acquire ownership of a fast mutex, and if
  60. successful, raises IRQL to APC level.
  61. Arguments:
  62. FastMutex - Supplies a pointer to a fast mutex.
  63. Return Value:
  64. If the fast mutex was successfully acquired, then a value of TRUE
  65. is returned as the function value. Otherwise, a value of FALSE is
  66. returned.
  67. --*/
  68. {
  69. return xxTryToAcquireFastMutex(FastMutex);
  70. }
  71. #undef ExAcquireFastMutexUnsafe
  72. VOID
  73. ExAcquireFastMutexUnsafe (
  74. IN PFAST_MUTEX FastMutex
  75. )
  76. /*++
  77. Routine Description:
  78. This function acquires ownership of a fast mutex, but does not raise
  79. IRQL to APC Level.
  80. Arguments:
  81. FastMutex - Supplies a pointer to a fast mutex.
  82. Return Value:
  83. None.
  84. --*/
  85. {
  86. xxAcquireFastMutexUnsafe(FastMutex);
  87. return;
  88. }
  89. #undef ExReleaseFastMutexUnsafe
  90. VOID
  91. ExReleaseFastMutexUnsafe (
  92. IN PFAST_MUTEX FastMutex
  93. )
  94. /*++
  95. Routine Description:
  96. This function releases ownership to a fast mutex, and does not restore
  97. IRQL to its previous level.
  98. Arguments:
  99. FastMutex - Supplies a pointer to a fast mutex.
  100. Return Value:
  101. None.
  102. --*/
  103. {
  104. xxReleaseFastMutexUnsafe(FastMutex);
  105. return;
  106. }
  107. #endif