Details
Diff Detail
Event Timeline
+dmitry
Dmitry, PTAL at this patch. Also, do we have the list of annotations documented or described anywhere? Shouldn't we make a public header containing them at some point? Forcing users to declare them with "extern "C"" is ugly.
lib/tsan/rtl/tsan_interface_ann.cc | ||
---|---|---|
425 | Don't you need to use another name here? | |
test/tsan/thread_name.cc | ||
7 | Shouldn't it be __GLIBC_PREREQ(2, 12) ? |
FreeBSD supports setting thread names via (from pthread_np.h):
void pthread_set_name_np(pthread_t tid, const char *name);
test/tsan/thread_name.cc | ||
---|---|---|
25 | The FreeBSD equivalent is (in pthread_np.h): void pthread_set_name_np(pthread_t tid, const char *name); |
lib/tsan/rtl/tsan_interface_ann.cc | ||
---|---|---|
423 | Please don't add new annotations. They are supported only for historical reasons. A test is definitely not a reason to add an annotation. Emaste says there is pthread_set_name_np on freebsd; if it's so, use it in the test and intercept it in tsan_interceptors.cc. Otherwise disable the test on freebsd. |
Also, do we have the list of annotations documented or described anywhere? Shouldn't we make a public header containing them at some point? Forcing users to declare them with "extern "C"" is ugly.
Please don't make annotations any more convenient to use. They are ugly and they should feel ugly.
Emaste says there is pthread_set_name_np on freebsd; if it's so, use it in the test and intercept it in tsan_interceptors.cc.
pthread_set_name_np has existed on FreeBSD since 1998 so there's no need for a version check either.
test/tsan/thread_name.cc | ||
---|---|---|
18 | BTW, shouldn't it be defined(__linux__) && ...? |
BTW, shouldn't it be defined(linux) && ...?
Currently C/C++ tsan works only on linux, so we don't use defined(linux) everywhere.
Please don't add new annotations. They are supported only for historical reasons. A test is definitely not a reason to add an annotation.
Emaste says there is pthread_set_name_np on freebsd; if it's so, use it in the test and intercept it in tsan_interceptors.cc. Otherwise disable the test on freebsd.
Or just disable the test on freebsd. Thread names is not critical functionality.