redis.cs 630 B

12345678910111213141516171819202122232425262728
  1. namespace SiteCore.Redis
  2. {
  3. public class redis
  4. {
  5. private static RedisHelp _instance;
  6. private static readonly object rLocker = new object();
  7. public static RedisHelp RedisHelper
  8. {
  9. get
  10. {
  11. if (_instance == null)
  12. {
  13. lock (rLocker)
  14. {
  15. if (_instance == null)
  16. {
  17. _instance = new RedisHelp(1);
  18. }
  19. }
  20. }
  21. return _instance;
  22. }
  23. }
  24. }
  25. }