diff options
author | Tim Rowley <[email protected]> | 2017-07-21 11:38:39 -0500 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2017-08-03 00:19:06 +0100 |
commit | a488340bd1d7046aa022b4f12f26cc36ac0d7fb0 (patch) | |
tree | ca9ca94dab631a5391b8c41eb0d69b1fa50a0b7f | |
parent | 57bf8e1cd808e7333ca47289621b993bf199ddd6 (diff) |
swr/rast: quit using linux-specific gettid()
Linux-specific gettid() syscall shouldn't be used in portable code.
Fix does assume a 1:1 thread:LWP architecture, but works for our
current target platforms and can be revisited later if needed.
Fixes unresolved symbol in linux scons builds.
v2: add comment in code about the 1:1 assumption.
Cc: [email protected]
Reviewed-by: Bruce Cherniak <[email protected]>
(cherry picked from commit d1e7153228304eb1be85580cbfdea1a57c5f203b)
-rw-r--r-- | src/gallium/drivers/swr/rasterizer/codegen/templates/gen_ar_eventhandlerfile.hpp | 5 | ||||
-rw-r--r-- | src/gallium/drivers/swr/rasterizer/common/os.h | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/gallium/drivers/swr/rasterizer/codegen/templates/gen_ar_eventhandlerfile.hpp b/src/gallium/drivers/swr/rasterizer/codegen/templates/gen_ar_eventhandlerfile.hpp index 3a618a124de..9017e8dc7d8 100644 --- a/src/gallium/drivers/swr/rasterizer/codegen/templates/gen_ar_eventhandlerfile.hpp +++ b/src/gallium/drivers/swr/rasterizer/codegen/templates/gen_ar_eventhandlerfile.hpp @@ -67,8 +67,9 @@ namespace ArchRast char buf[255]; // There could be multiple threads creating thread pools. We // want to make sure they are uniquly identified by adding in - // the creator's thread id into the filename. - sprintf(buf, "%s/ar_event%d_%d.bin", "/tmp", GetCurrentThreadId(), id); + // the creator's thread (process) id into the filename. + // Assumes a 1:1 thread:LWP mapping as in linux. + sprintf(buf, "%s/ar_event%d_%d.bin", "/tmp", GetCurrentProcessId(), id); mFilename = std::string(buf); #endif } diff --git a/src/gallium/drivers/swr/rasterizer/common/os.h b/src/gallium/drivers/swr/rasterizer/common/os.h index 0b8f273bba4..e3f2e6633e5 100644 --- a/src/gallium/drivers/swr/rasterizer/common/os.h +++ b/src/gallium/drivers/swr/rasterizer/common/os.h @@ -235,8 +235,6 @@ void AlignedFree(void* p) #define sprintf_s sprintf #define strcpy_s(dst,size,src) strncpy(dst,src,size) #define GetCurrentProcessId getpid -pid_t gettid(void); -#define GetCurrentThreadId gettid #define CreateDirectory(name, pSecurity) mkdir(name, 0777) |