xiaobai added inline comments.

================
Comment at: source/Host/posix/HostThreadPosix.cpp:44
   if (IsJoinable()) {
 #ifndef __ANDROID__
 #ifndef __FreeBSD__
----------------
aprantl wrote:
> What about:
> ```
> #ifdef __ANDROID__
>     error.SetErrorString("HostThreadPosix::Cancel() not supported on 
> Android");
> #else
> #ifdef __FreeBSD__
>     int err = ::pthread_cancel(m_thread);
>     error.SetError(err, eErrorTypePOSIX);
> #else
>     llvm_unreachable("someone is calling HostThread::Cancel()");
> #endif
> #endif
>   }
>   return error;
> }
> ```
I agree with Adrian's suggestion, but I would add that you can remove one of 
the `#endif` if you use `#elif defined(__FreeBSD__)` instead of an `#else` + 
`#ifdef __FreeBSD__`.


https://reviews.llvm.org/D44056



_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to