Source code of Windows XP (NT5)
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.

40 lines
713 B

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Copyright (c) 1997-1999 Microsoft Corporation
  4. //
  5. // File:
  6. //
  7. // Contents:
  8. //
  9. // History:
  10. //
  11. //---------------------------------------------------------------------------
  12. #ifndef _PROTECT_H_
  13. #define _PROTECT_H_
  14. //////////////////////////////////////////////////////////////////////////////
  15. // Citrical section macros
  16. //
  17. #define INITLOCK( _sem ) \
  18. { \
  19. InitializeCriticalSection( _sem ); \
  20. }
  21. #define DELETELOCK( _sem ) \
  22. { \
  23. DeleteCriticalSection( _sem ); \
  24. }
  25. #define LOCK( _sem ) \
  26. { \
  27. EnterCriticalSection( _sem ); \
  28. }
  29. #define UNLOCK( _sem ) \
  30. { \
  31. LeaveCriticalSection( _sem ); \
  32. }
  33. #endif