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.

55 lines
1.6 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1996 - 1999
  6. //
  7. // File: eventlst.h
  8. //
  9. // Contents: Microsoft Internet Security Trust Provider
  10. //
  11. // History: 29-May-1997 pberkman created
  12. //
  13. //--------------------------------------------------------------------------
  14. #ifndef EVENTLST_H
  15. #define EVENTLST_H
  16. #ifdef __cplusplus
  17. extern "C"
  18. {
  19. #endif
  20. typedef struct _LIST_LOCK
  21. {
  22. HANDLE hMutexNoWriter;
  23. HANDLE hEventNoReaders;
  24. LONG NumReaders;
  25. DWORD dwDebugMask;
  26. } LIST_LOCK, *PLIST_LOCK;
  27. extern BOOL InitializeListLock(LIST_LOCK *pListLock, DWORD dwDebugMask);
  28. extern BOOL LockFree(LIST_LOCK *pListLock);
  29. extern BOOL InitializeListEvent(HANDLE *phListLock);
  30. extern BOOL EventFree(HANDLE hListLock);
  31. extern void LockWaitToWrite(LIST_LOCK *pListLock);
  32. extern void LockDoneWriting(LIST_LOCK *pListLock);
  33. extern void LockWaitToRead(LIST_LOCK *pListLock);
  34. extern void LockDoneReading(LIST_LOCK *pListLock);
  35. #define SetListEvent(hListEvent) ((void)SetEvent(hListEvent))
  36. #define ResetListEvent(hListEvent) ((void)ResetEvent(hListEvent))
  37. #define WaitForListEvent(hListEvent) (WaitForSingleObject(hListEvent, INFINITE))
  38. #define AcquireReadLock(sListLock) (LockWaitToRead(&sListLock))
  39. #define ReleaseReadLock(sListLock) (LockDoneReading(&sListLock))
  40. #define AcquireWriteLock(sListLock) (LockWaitToWrite(&sListLock))
  41. #define ReleaseWriteLock(sListLock) (LockDoneWriting(&sListLock))
  42. #ifdef __cplusplus
  43. }
  44. #endif
  45. #endif // EVENTLST_H