DefaultContainerLockPolicy.h 953 B

1234567891011121314151617181920212223242526272829
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. #pragma once
  6. namespace Js
  7. {
  8. class DefaultContainerLockPolicy
  9. {
  10. public:
  11. class NoLock
  12. {
  13. public:
  14. template <class SyncObject>
  15. NoLock(const SyncObject&)
  16. {
  17. // No lock, do nothing.
  18. }
  19. };
  20. typedef AutoCriticalSection DefaultLock;
  21. typedef NoLock ReadLock; // To read/map items. Default to no lock.
  22. typedef NoLock WriteLock; // To write an item. Default to no lock.
  23. typedef DefaultLock AddRemoveLock; // To add/remove item
  24. };
  25. }