what_thread_does.cpp 475 B

12345678910111213141516171819202122
  1. #include "what_thread_does.h"
  2. #include "thread_extra.h"
  3. #include <util/system/tls.h>
  4. Y_POD_STATIC_THREAD(const char*)
  5. WhatThreadDoes;
  6. const char* PushWhatThreadDoes(const char* what) {
  7. const char* r = NTSAN::RelaxedLoad(&WhatThreadDoes);
  8. NTSAN::RelaxedStore(&WhatThreadDoes, what);
  9. return r;
  10. }
  11. void PopWhatThreadDoes(const char* prev) {
  12. NTSAN::RelaxedStore(&WhatThreadDoes, prev);
  13. }
  14. const char** WhatThreadDoesLocation() {
  15. return &WhatThreadDoes;
  16. }