mutex debugging log

This commit is contained in:
georgemoralis 2023-11-11 10:01:16 +02:00
parent 5f825fc8a8
commit dbaf38dc7d
1 changed files with 3 additions and 3 deletions

View File

@ -134,7 +134,7 @@ int PS4_SYSV_ABI scePthreadMutexInit(ScePthreadMutex* mutex, const ScePthreadMut
if (name != nullptr) { if (name != nullptr) {
(*mutex)->name = name; (*mutex)->name = name;
} else { } else {
(*mutex)->name = "dummy"; (*mutex)->name = "noname";
} }
int result = pthread_mutex_init(&(*mutex)->pth_mutex, &(*attr)->pth_mutex_attr); int result = pthread_mutex_init(&(*mutex)->pth_mutex, &(*attr)->pth_mutex_attr);
@ -202,7 +202,7 @@ int PS4_SYSV_ABI scePthreadMutexLock(ScePthreadMutex* mutex) {
} }
int result = pthread_mutex_lock(&(*mutex)->pth_mutex); int result = pthread_mutex_lock(&(*mutex)->pth_mutex);
printf("mutex lock: %s, %d\n", (*mutex)->name.c_str(), result); LOG_INFO_IF(log_pthread_file, "scePthreadMutexLock name={} result={}\n", (*mutex)->name, result);
switch (result) { switch (result) {
case 0: return SCE_OK; case 0: return SCE_OK;
case EAGAIN: return SCE_KERNEL_ERROR_EAGAIN; case EAGAIN: return SCE_KERNEL_ERROR_EAGAIN;
@ -219,7 +219,7 @@ int PS4_SYSV_ABI scePthreadMutexUnlock(ScePthreadMutex* mutex) {
} }
int result = pthread_mutex_unlock(&(*mutex)->pth_mutex); int result = pthread_mutex_unlock(&(*mutex)->pth_mutex);
printf("mutex unlock: %s, %d\n", (*mutex)->name.c_str(), result); LOG_INFO_IF(log_pthread_file, "scePthreadMutexUnlock name={} result={}\n", (*mutex)->name, result);
switch (result) { switch (result) {
case 0: return SCE_OK; case 0: return SCE_OK;