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: mesa-stable@lists.freedesktop.org Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
This commit is contained in:
parent
eaa56eab6d
commit
d1e7153228
|
@ -67,8 +67,9 @@ namespace ArchRast
|
||||||
char buf[255];
|
char buf[255];
|
||||||
// There could be multiple threads creating thread pools. We
|
// There could be multiple threads creating thread pools. We
|
||||||
// want to make sure they are uniquly identified by adding in
|
// want to make sure they are uniquly identified by adding in
|
||||||
// the creator's thread id into the filename.
|
// the creator's thread (process) id into the filename.
|
||||||
sprintf(buf, "%s/ar_event%d_%d.bin", "/tmp", GetCurrentThreadId(), id);
|
// 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);
|
mFilename = std::string(buf);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -237,8 +237,6 @@ void AlignedFree(void* p)
|
||||||
#define sprintf_s sprintf
|
#define sprintf_s sprintf
|
||||||
#define strcpy_s(dst,size,src) strncpy(dst,src,size)
|
#define strcpy_s(dst,size,src) strncpy(dst,src,size)
|
||||||
#define GetCurrentProcessId getpid
|
#define GetCurrentProcessId getpid
|
||||||
pid_t gettid(void);
|
|
||||||
#define GetCurrentThreadId gettid
|
|
||||||
|
|
||||||
#define InterlockedCompareExchange(Dest, Exchange, Comparand) __sync_val_compare_and_swap(Dest, Comparand, Exchange)
|
#define InterlockedCompareExchange(Dest, Exchange, Comparand) __sync_val_compare_and_swap(Dest, Comparand, Exchange)
|
||||||
#define InterlockedExchangeAdd(Addend, Value) __sync_fetch_and_add(Addend, Value)
|
#define InterlockedExchangeAdd(Addend, Value) __sync_fetch_and_add(Addend, Value)
|
||||||
|
|
Loading…
Reference in New Issue