New file |
| | |
| | | Patch imported from https://sourceforge.net/p/sbcl/sbcl/ci/8fc35f2c2a3d794bc90556b85fa7eb0fa6b220e9/ |
| | | |
| | | --- a/src/compiler/generic/genesis.lisp |
| | | +++ b/src/compiler/generic/genesis.lisp |
| | | @@ -3373,7 +3373,7 @@ |
| | | (write-structure-object (layout-info (find-layout 'sb-thread::thread)) |
| | | *standard-output* "thread_instance" nil) |
| | | (write-structure-object (layout-info (find-layout 'sb-thread::mutex)) |
| | | - *standard-output* "mutex" nil) |
| | | + *standard-output* "lispmutex" nil) |
| | | ;; The os_thread field is either pthread_t or lispobj. |
| | | ;; If no threads, then it's lispobj. #+win32 uses lispobj too |
| | | ;; but it gets cast to HANDLE upon use. |
| | | --- a/src/runtime/backtrace.c |
| | | +++ b/src/runtime/backtrace.c |
| | | @@ -721,7 +721,7 @@ |
| | | // and a mutex have a name at the same slot offset (if #+sb-futex). |
| | | // So to reiterate the comment from linux-os.c - |
| | | // "Use this only if you know what you're doing" |
| | | - struct mutex* lispmutex = (void*)native_pointer(lispthread->waiting_for); |
| | | + struct lispmutex* lispmutex = (void*)native_pointer(lispthread->waiting_for); |
| | | if (lispmutex->name != NIL) { |
| | | fprintf(stderr, " (MUTEX:\""); |
| | | print_string(VECTOR(lispmutex->name), stderr); |
| | | --- a/src/runtime/linux-os.c |
| | | +++ b/src/runtime/linux-os.c |
| | | @@ -125,7 +125,7 @@ |
| | | rel_time.tv_sec -= basetime.tv_sec; |
| | | rel_time.tv_nsec -= basetime.tv_nsec; |
| | | if (rel_time.tv_nsec<0) rel_time.tv_nsec += 1000 * 1000 * 1000, rel_time.tv_sec--; |
| | | - lispobj threadname = ti->name; |
| | | + lispobj threadname = ti->_name; |
| | | if (events[i].timeout >= 0) // must also have mutex_name in this case |
| | | fprintf(stderr, "[%d.%09ld] %s: %s '%s' timeout %ld\n", |
| | | (int)rel_time.tv_sec, rel_time.tv_nsec, |
| | | @@ -216,8 +216,8 @@ |
| | | int t; |
| | | |
| | | #ifdef MUTEX_EVENTRECORDING |
| | | - struct mutex* m = (void*)((char*)lock_word - offsetof(struct mutex,state)); |
| | | - char *name = m->name != NIL ? vector_sap((m->name) : "(unnamed)"; |
| | | + struct lispmutex* m = (void*)((char*)lock_word - offsetof(struct lispmutex,uw_state)); |
| | | + char *name = m->name != NIL ? vector_sap(m->name) : "(unnamed)"; |
| | | #endif |
| | | if (sec<0) { |
| | | lisp_mutex_event1("start futex wait", name); |
| | | @@ -245,7 +245,7 @@ |
| | | futex_wake(int *lock_word, int n) |
| | | { |
| | | #ifdef MUTEX_EVENTRECORDING |
| | | - struct mutex* m = (void*)((char*)lock_word - offsetof(struct mutex,state)); |
| | | + struct lispmutex* m = (void*)((char*)lock_word - offsetof(struct lispmutex,uw_state)); |
| | | char *name = m->name != NIL ? vector_sap(m->name) : "(unnamed)"; |
| | | lisp_mutex_event1("waking futex", name); |
| | | #endif |
| | | |