Tags: google/nsync
Tags
platform: nsync futex: fix build on riscv32 (#18) RISCV glibc has decided to use 64bit time_t from get go unlike other 32bit architecture therefore aliasing __NR_futex to __NR_futex_time64 helps avoid the below errors on rv32 error: '__NR_futex' was not declared in this scope | 21 | return (syscall (__NR_futex, uaddr, op, val, timeout, uaddr2, val3)); | |
Update nsync Thread Sanitizer (TSan) annotations. I had previously added some TSan dynamic annotations to nsync to avoid TSan race warnings. However, depending on whether gcc or clang was used, and depending on the version of clang used, TSan race warnings could be reported on the nsync tests. When TSan is in used, this change adds a call to AnnotateRWLockAcquired just after each nsync mu acquistion, and a call AnnotateRWLockReleased just before each release. Additionally, AnnotateRWLockCreate is called at each mu creation. (nsync mutex destruction is inferred when memory is recycled.) Macros are used so that these additional calls are not introduced when TSan is not in use. All tests now pass without warnings in TSan mode in both clang and gcc, including in all the versions that previously reported warnings. In addition, the version number is incremented, and there are a few minor whitespace changes to make the TSan annotations conform the the project's whitespace conventions.
In nsync, avoid an ABSL depepdency for TSAN annotations. The code used to use ABSL macros for TSAN annotations that suppress warnings. This was a problem because: - ABSL is changing the names of the macros(!), and the team seems intent on forcing clients to make the incompatible change, even if the users of those clients have not yet switched to a suifficiently recent version of ABSL. And they are doing this despite their (apparently false) claim of a 5-year API stability guarantee. - The code had hard-wired a header file path that was wrong for most users, effectively preventing them from running with TSAN. - The conditional compilation to detect TSAN worked only for clang, and not for gcc, even though gcc supports TSAN. This change drops the ABSL dependency so there's no header file to include; it uses conditional compilation that detects TSAN on moth gcc and clang; and it uses the gcc/clang annotation routines directly. The version number is also increased.
PreviousNext