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;
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,
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 <<
"'.";
85 return is_creation_thread_current;