summaryrefslogtreecommitdiffstats
path: root/src/util/u_thread.h
Commit message (Collapse)AuthorAgeFilesLines
* util: Cygwin has linux-style pthread_setname_npJon Turney2019-08-091-1/+1
| | | | Fixes: dcf9d91a ("util: Handle differences in pthread_setname_np")
* util: fix cpuset support on FreeBSDGreg V2019-08-081-0/+7
| | | | Reviewed-by: Eric Engestrom <[email protected]>
* util: fix pointer type on NetBSDEric Engestrom2019-08-031-1/+1
| | | | | | | | | | | NetBSD expects a `void *` argument [1] as the printf-style arguments to the formatting string, so we need to cast the `const` away. [1] https://netbsd.gw.com/cgi-bin/man-cgi?pthread_setname_np++NetBSD-current Suggested-by: Kamil Rytarowski <[email protected]> Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* util: Handle differences in pthread_setname_npMatt Turner2019-08-021-0/+11
| | | | | | | | | | | | | | | There are a lot of unfortunate differences in the implementation of this function. NetBSD and Mac OS X in particular require different arguments. https://stackoverflow.com/questions/2369738/how-to-set-the-name-of-a-thread-in-linux-pthreads/7989973#7989973 provides for a good overview of the differences. Fixes: 9c411e020d1 ("util: Drop preprocessor guards for glibc-2.12") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111264 Reviewed-by: Eric Engestrom <[email protected]> [Eric: use DETECT_OS_* instead of PIPE_OS_*] Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* util: Drop preprocessor guards for glibc-2.12Matt Turner2019-07-301-7/+0
| | | | | | | | glibc-2.12 was released in 2010. No one is building new Mesa against 9 year old glibc, and removing these checks allows the code to work on other C libraries like musl. Acked-by: Eric Engestrom <[email protected]>
* util: Don't block SIGSYS for new threadsDrew Davenport2019-02-261-1/+2
| | | | | | SIGSYS is needed for programs using seccomp for sandboxing. Reviewed-by: Marek Olšák <[email protected]>
* move pthread_setaffinity_np check to the build systemDylan Baker2018-09-171-4/+0
| | | | | | | | | | | | | | | | | Rather than trying to encode all of the rules in a header, lets just put them in the build system where they belong. This fixes the build on FreeBSD, which does have pthraed_setaffinity_np, but it's in a pthread_np.h, not behind _GNU_SOURCE. FreeBSD also implements cpu_set slightly differently, so additional changes would be required to get it working right there anyway. v2: - fix #define in autotools Fixes: 9f1bbbdbbd77d346c74c7abbb31f399151a85713 ("util: try to fix the Android and MacOS build") Cc: Emil Velikov <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* util: try to fix the Android and MacOS buildMarek Olšák2018-09-101-2/+5
| | | | | | | | Bionic does not have pthread_setaffinity_np. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107869 Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Tapani Pälli <[email protected]>
* st/mesa: pin driver threads to a specific L3 cache on AMD Zen (v2)Marek Olšák2018-09-071-0/+57
| | | | | | v2: use set_context_param Reviewed-by: Brian Paul <[email protected]>
* u_thread: Use pthread_setname_np on linux only.Samuel Thibault2018-01-221-1/+2
| | | | | | | pthread_setname_np was added in glibc 2.12 for the Linux port only, other ports do not necessarily have it. Signed-off-by: Jose Fonseca <[email protected]>
* util/u_thread: fix compilation on Mac OSNicolai Hähnle2017-11-101-1/+1
| | | | | | | | | | | | Apparently, it doesn't have pthread barriers. p_config.h (which was originally used to guard this code) uses the __APPLE__ macro to detect Mac OS. Fixes: f0d3a4de75 ("util: move pipe_barrier into src/util and rename to util_barrier") Cc: Roland Scheidegger <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* util: move pipe_barrier into src/util and rename to util_barrierNicolai Hähnle2017-11-091-0/+74
| | | | | | | | | The #if guard is probably not 100% equivalent to the previous PIPE_OS check, but if anything it should be an over-approximation (are there pthread implementations without barriers?), so people will get either a good implementation or compile errors that are easy to fix. Reviewed-by: Marek Olšák <[email protected]>
* util: move pipe_thread_is_self from gallium to src/utilMarek Olšák2017-06-261-0/+12
| | | | Reviewed-by: Timothy Arceri <[email protected]>
* util/u_thread.h: Include stdint.h for int64_t definition.Jose Fonseca2017-03-131-0/+2
| | | | Fixes MinGW build. Trivial.
* util: add u_thread.hTimothy Arceri2017-03-121-0/+89
This is a minimal copy of os_thread.h from gallium in order to move u_queue.{c,h} to this directory. Reviewed-by: Marek Olšák <[email protected]>