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.

73 lines
806 B

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. etimer.h
  5. Abstract:
  6. SIS Groveler event timer include file
  7. Authors:
  8. John Douceur, 1998
  9. Environment:
  10. User Mode
  11. Revision History:
  12. --*/
  13. #ifndef _INC_ETIMER
  14. #define _INC_ETIMER
  15. typedef void (*EventCallback)(void *);
  16. class EventTimer
  17. {
  18. public:
  19. EventTimer();
  20. ~EventTimer();
  21. void run();
  22. void halt();
  23. void schedule(
  24. unsigned int event_time,
  25. void *context,
  26. EventCallback callback);
  27. private:
  28. struct Event
  29. {
  30. unsigned int event_time;
  31. void *context;
  32. EventCallback callback;
  33. };
  34. struct HeapSegment
  35. {
  36. HeapSegment *previous;
  37. HeapSegment *next;
  38. Event events[1];
  39. };
  40. HeapSegment *first_segment, *last_segment;
  41. int population;
  42. int segment_size;
  43. bool heap_ok;
  44. bool running;
  45. };
  46. #endif /* _INC_ETIMER */