mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-29 02:31:18 +00:00
XQuartz: A little more debugging output from threadSafety
(cherry picked from commit f6fbdbf838ab77c3a4635f0b2356b1bbb060ff5b)
This commit is contained in:
parent
0d61f6fca1
commit
55f80d7545
2 changed files with 15 additions and 5 deletions
|
|
@ -36,7 +36,7 @@
|
|||
pthread_t SERVER_THREAD;
|
||||
pthread_t APPKIT_THREAD;
|
||||
|
||||
static void spewCallStack(void) {
|
||||
static inline void spewCallStack(void) {
|
||||
void* callstack[128];
|
||||
int i, frames = backtrace(callstack, 128);
|
||||
char** strs = backtrace_symbols(callstack, frames);
|
||||
|
|
@ -48,12 +48,13 @@ static void spewCallStack(void) {
|
|||
free(strs);
|
||||
}
|
||||
|
||||
void threadAssert(pthread_t tid) {
|
||||
void _threadAssert(pthread_t tid, const char *file, const char *fun, int line) {
|
||||
if(pthread_equal(pthread_self(), tid))
|
||||
return;
|
||||
|
||||
/* NOOOO! */
|
||||
ErrorF("Thread Assertion Failed: self=%s, expected=%s\n",
|
||||
threadSafetyID(pthread_self()), threadSafetyID(tid));
|
||||
ErrorF("Thread Assertion Failed: self=%s, expected=%s\n%s:%s:%d\n",
|
||||
threadSafetyID(pthread_self()), threadSafetyID(tid),
|
||||
file, fun, line);
|
||||
spewCallStack();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue