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.

102 lines
2.0 KiB

  1. /*
  2. Copyright (c) 1992 Microsoft Corporation
  3. Module Name:
  4. scavengr.h
  5. Abstract:
  6. This file defines the scavenger thread interface.
  7. Author:
  8. Jameel Hyder (microsoft!jameelh)
  9. Revision History:
  10. 25 Jun 1992 Initial Version
  11. Notes: Tab stop: 4
  12. --*/
  13. #ifndef _SCAVENGER_
  14. #define _SCAVENGER_
  15. typedef AFPSTATUS (FASTCALL *SCAVENGER_ROUTINE)(IN PVOID Parameter);
  16. extern
  17. NTSTATUS
  18. AfpScavengerInit(
  19. VOID
  20. );
  21. extern
  22. VOID
  23. AfpScavengerDeInit(
  24. VOID
  25. );
  26. extern
  27. NTSTATUS
  28. AfpScavengerScheduleEvent(
  29. IN SCAVENGER_ROUTINE Worker, // Routine to invoke when time expires
  30. IN PVOID pContext, // Context to pass to the routine
  31. IN LONG DeltaTime, // Schedule after this much time
  32. IN BOOLEAN fQueue // If TRUE, then worker must be queued
  33. );
  34. extern
  35. BOOLEAN
  36. AfpScavengerKillEvent(
  37. IN SCAVENGER_ROUTINE Worker, // Routine that was scheduled
  38. IN PVOID pContext // Context
  39. );
  40. extern
  41. VOID
  42. AfpScavengerFlushAndStop(
  43. VOID
  44. );
  45. #ifdef _SCAVENGER_LOCALS
  46. // Keep this at a ONE second level. Most clients should be using close to
  47. // 10 ticks or so.
  48. #define AFP_SCAVENGER_TIMER_TICK -1*NUM_100ns_PER_SECOND
  49. typedef struct _ScavengerList
  50. {
  51. struct _ScavengerList * scvgr_Next; // Link to next
  52. LONG scvgr_AbsTime; // Absolute time
  53. LONG scvgr_RelDelta; // Relative to the previous entry
  54. BOOLEAN scvgr_fQueue; // If TRUE, should always be queued
  55. SCAVENGER_ROUTINE scvgr_Worker; // Real Worker
  56. PVOID scvgr_Context; // Real context
  57. WORK_ITEM scvgr_WorkItem; // Used for queueing to worker thread
  58. } SCAVENGERLIST, *PSCAVENGERLIST;
  59. LOCAL KTIMER afpScavengerTimer = { 0 };
  60. LOCAL KDPC afpScavengerDpc = { 0 };
  61. LOCAL BOOLEAN afpScavengerStopped = False;
  62. LOCAL PSCAVENGERLIST afpScavengerList = NULL;
  63. LOCAL AFP_SPIN_LOCK afpScavengerLock = { 0 };
  64. LOCAL VOID
  65. afpScavengerDpcRoutine(
  66. IN PKDPC pKDpc,
  67. IN PVOID pContext,
  68. IN PVOID SystemArgument1,
  69. IN PVOID SystemArgument2
  70. );
  71. LOCAL VOID FASTCALL
  72. afpScavengerWorker(
  73. IN PSCAVENGERLIST pList
  74. );
  75. #endif // _SCAVENGER_LOCALS
  76. #endif // _SCAVENGER_
  77.