mirror of
https://github.com/libretro/RetroArch
synced 2025-01-31 06:32:48 +00:00
Merge pull request #7336 from libretro/switch_nxlink_threading
Switch nxlink threading
This commit is contained in:
commit
6847bb8845
@ -94,8 +94,6 @@ static ssize_t switch_audio_write(void *data, const void *buf, size_t size)
|
|||||||
{
|
{
|
||||||
if (swa->blocking)
|
if (swa->blocking)
|
||||||
{
|
{
|
||||||
RARCH_LOG("No buffer, blocking...\n");
|
|
||||||
|
|
||||||
while(swa->current_buffer == NULL)
|
while(swa->current_buffer == NULL)
|
||||||
{
|
{
|
||||||
uint32_t handle_idx = 0;
|
uint32_t handle_idx = 0;
|
||||||
|
@ -62,6 +62,10 @@ static uint32_t *splashData = NULL;
|
|||||||
|
|
||||||
static bool psmInitialized = false;
|
static bool psmInitialized = false;
|
||||||
|
|
||||||
|
#ifdef NXLINK
|
||||||
|
extern bool nxlink_connected;
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // HAVE_LIBNX
|
#endif // HAVE_LIBNX
|
||||||
|
|
||||||
static void get_first_valid_core(char *path_return)
|
static void get_first_valid_core(char *path_return)
|
||||||
@ -614,7 +618,7 @@ static void frontend_switch_init(void *data)
|
|||||||
#endif // HAVE_OPENGL
|
#endif // HAVE_OPENGL
|
||||||
#ifdef NXLINK
|
#ifdef NXLINK
|
||||||
socketInitializeDefault();
|
socketInitializeDefault();
|
||||||
nxlinkStdio();
|
nxlink_connected = nxlinkStdio() != -1;
|
||||||
#ifndef IS_SALAMANDER
|
#ifndef IS_SALAMANDER
|
||||||
verbosity_enable();
|
verbosity_enable();
|
||||||
#endif // IS_SALAMANDER
|
#endif // IS_SALAMANDER
|
||||||
|
19
verbosity.c
19
verbosity.c
@ -63,6 +63,11 @@ static void* log_file_buf = NULL;
|
|||||||
static bool main_verbosity = false;
|
static bool main_verbosity = false;
|
||||||
static bool log_file_initialized = false;
|
static bool log_file_initialized = false;
|
||||||
|
|
||||||
|
#ifdef NXLINK
|
||||||
|
static Mutex nxlink_mtx;
|
||||||
|
bool nxlink_connected = false;
|
||||||
|
#endif
|
||||||
|
|
||||||
void verbosity_enable(void)
|
void verbosity_enable(void)
|
||||||
{
|
{
|
||||||
main_verbosity = true;
|
main_verbosity = true;
|
||||||
@ -101,6 +106,11 @@ void retro_main_log_file_init(const char *path)
|
|||||||
if (log_file_initialized)
|
if (log_file_initialized)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#ifdef NXLINK
|
||||||
|
if (path == NULL && nxlink_connected)
|
||||||
|
mutexInit(&nxlink_mtx);
|
||||||
|
#endif
|
||||||
|
|
||||||
log_file_fp = stderr;
|
log_file_fp = stderr;
|
||||||
if (path == NULL)
|
if (path == NULL)
|
||||||
return;
|
return;
|
||||||
@ -199,6 +209,10 @@ void RARCH_LOG_V(const char *tag, const char *fmt, va_list ap)
|
|||||||
|
|
||||||
ui_companion_driver_log_msg(buffer);
|
ui_companion_driver_log_msg(buffer);
|
||||||
#else
|
#else
|
||||||
|
#if defined(NXLINK) && !defined(HAVE_FILE_LOGGER)
|
||||||
|
if (nxlink_connected)
|
||||||
|
mutexLock(&nxlink_mtx);
|
||||||
|
#endif
|
||||||
if (fp)
|
if (fp)
|
||||||
{
|
{
|
||||||
fprintf(fp, "%s ",
|
fprintf(fp, "%s ",
|
||||||
@ -206,6 +220,11 @@ void RARCH_LOG_V(const char *tag, const char *fmt, va_list ap)
|
|||||||
vfprintf(fp, fmt, ap);
|
vfprintf(fp, fmt, ap);
|
||||||
fflush(fp);
|
fflush(fp);
|
||||||
}
|
}
|
||||||
|
#if defined(NXLINK) && !defined(HAVE_FILE_LOGGER)
|
||||||
|
if (nxlink_connected)
|
||||||
|
mutexUnlock(&nxlink_mtx);
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user