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.

78 lines
2.9 KiB

  1. #ifndef _SLIST_HPP_
  2. #define _SLIST_HPP_
  3. // Ruler
  4. // 1 2 3 4 5 6 7 8
  5. //345678901234567890123456789012345678901234567890123456789012345678901234567890
  6. /********************************************************************/
  7. /* */
  8. /* The standard layout. */
  9. /* */
  10. /* The standard layout for 'hpp' files for this code is as */
  11. /* follows: */
  12. /* */
  13. /* 1. Include files. */
  14. /* 2. Constants exported from the class. */
  15. /* 3. Data structures exported from the class. */
  16. /* 4. Forward references to other data structures. */
  17. /* 5. Class specifications (including inline functions). */
  18. /* 6. Additional large inline functions. */
  19. /* */
  20. /* Any portion that is not required is simply omitted. */
  21. /* */
  22. /********************************************************************/
  23. #include "Global.hpp"
  24. #include "Assembly.hpp"
  25. /********************************************************************/
  26. /* */
  27. /* A lockless list. */
  28. /* */
  29. /* An SList is a lockless list suitable for high contention */
  30. /* SMP access. */
  31. /* */
  32. /********************************************************************/
  33. class SLIST : public ASSEMBLY
  34. {
  35. //
  36. // Private type definitions.
  37. //
  38. typedef struct
  39. {
  40. SLIST *Address;
  41. SBIT16 Size;
  42. SBIT16 Version;
  43. }
  44. SLIST_HEADER;
  45. //
  46. // Private data.
  47. //
  48. VOLATILE SBIT64 Header;
  49. public:
  50. //
  51. // Public functions.
  52. //
  53. SLIST( VOID );
  54. BOOLEAN Pop( SLIST **Element );
  55. VOID PopAll( SLIST **List );
  56. VOID Push( SLIST *Element );
  57. ~SLIST( VOID );
  58. private:
  59. //
  60. // Disabled operations.
  61. //
  62. SLIST( CONST SLIST & Copy );
  63. VOID operator=( CONST SLIST & Copy );
  64. };
  65. #endif