Better logging pthread_setspecific (flutter/engine#26460)

This commit is contained in:
Kaushik Iska
2021-05-27 16:34:02 -05:00
committed by GitHub
parent 4187feb4e6
commit 95e8dbe246

View File

@@ -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;
}