61 {
62 pthread_t current_thread = pthread_self();
63 bool is_creation_thread_current = !!pthread_equal(current_thread, self_);
64 if (disable_next_failure_ && !is_creation_thread_current) {
65 disable_next_failure_ = false;
66 return true;
67 }
68#ifdef __APPLE__
69
70
71 if (!is_creation_thread_current) {
72 static const int buffer_length = 128;
73 char expected_thread[buffer_length];
74 char actual_thread[buffer_length];
75 if (0 == pthread_getname_np(current_thread, actual_thread,
76 buffer_length) &&
77 0 == pthread_getname_np(self_, expected_thread, buffer_length)) {
78 FML_DLOG(
ERROR) <<
"Object referenced on a thread other than the one "
79 "on which it was created. Expected thread: '"
80 << expected_thread << "'. Actual thread: '"
81 << actual_thread << "'.";
82 }
83 }
84#endif
85 return is_creation_thread_current;
86 }
#define FML_DLOG(severity)