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.

23 lines
493 B

2 years ago
  1. using System.Threading;
  2. namespace EasyNet.Manager
  3. {
  4. public class ManagerThread
  5. {
  6. private static ThreadLocal<DbManager> m_ManagerLocal = new ThreadLocal<DbManager>();
  7. public static void Set(DbManager m)
  8. {
  9. m_ManagerLocal.Value = m;
  10. }
  11. public static DbManager Get()
  12. {
  13. return m_ManagerLocal.Value;
  14. }
  15. public static void Clear()
  16. {
  17. m_ManagerLocal.Value = null;
  18. }
  19. }
  20. }