Add NetBSD support in Host::GetCurrentThreadID

Summary:
To retrieve the native thread ID there must be called _lwp_self().

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, clayborg, emaste, labath

Reviewed By: joerg, clayborg, labath

Subscribers: #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D29264

llvm-svn: 293625
This commit is contained in:
Kamil Rytarowski 2017-01-31 13:38:42 +00:00
parent 753625b62e
commit e5c6a32163

View File

@ -40,6 +40,10 @@
#include <pthread_np.h>
#endif
#if defined(__NetBSD__)
#include <lwp.h>
#endif
// C++ Includes
// Other libraries and framework includes
@ -320,6 +324,8 @@ lldb::tid_t Host::GetCurrentThreadID() {
return thread_self;
#elif defined(__FreeBSD__)
return lldb::tid_t(pthread_getthreadid_np());
#elif defined(__NetBSD__)
return lldb::tid_t(_lwp_self());
#elif defined(__ANDROID__)
return lldb::tid_t(gettid());
#elif defined(__linux__)