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
884 B

  1. // MasterLock.cpp -- Master Lock routine definitions
  2. // (c) Copyright Schlumberger Technology Corp., unpublished work, created
  3. // 1999. This computer program includes Confidential, Proprietary
  4. // Information and is a Trade Secret of Schlumberger Technology Corp. All
  5. // use, disclosure, and/or reproduction is prohibited unless authorized
  6. // in writing. All Rights Reserved.
  7. #include "NoWarning.h"
  8. #include "ForceLib.h"
  9. #include "MasterLock.h"
  10. /////////////////////////// LOCAL/HELPER /////////////////////////////////
  11. namespace
  12. {
  13. Lockable *pMasterLock = 0;
  14. }
  15. /////////////////////////// PUBLIC /////////////////////////////////
  16. void
  17. DestroyMasterLock()
  18. {
  19. delete pMasterLock;
  20. }
  21. void
  22. SetupMasterLock()
  23. {
  24. // Assume no multi-threading issues
  25. if (!pMasterLock)
  26. pMasterLock = new Lockable;
  27. }
  28. Lockable &
  29. TheMasterLock()
  30. {
  31. return *pMasterLock;
  32. }