Skip to content

Commit

Permalink
Better logging pthread_setspecific (flutter#26460)
Browse files Browse the repository at this point in the history
  • Loading branch information
iskakaushik authored May 27, 2021
1 parent 67c5bf0 commit e1becf4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fml/thread_local.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ void* ThreadLocalPointer::get() const {

void* ThreadLocalPointer::swap(void* ptr) {
void* old_ptr = get();
FML_CHECK(pthread_setspecific(key_, ptr) == 0);
int err = pthread_setspecific(key_, ptr);
if (err) {
FML_CHECK(false) << "pthread_setspecific failed (" << err
<< "): " << strerror(err);
}
return old_ptr;
}

Expand Down

0 comments on commit e1becf4

Please sign in to comment.