Skip to content

Commit

Permalink
add libogc functions for threading via GEKKO define (#312)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamiras authored Jan 20, 2024
1 parent e7989c3 commit 08c4118
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion src/rc_compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ struct tm* rc_gmtime_s(struct tm* buf, const time_t* timer)
#endif

#ifndef RC_NO_THREADS
#ifdef _WIN32

#if defined(_WIN32)

/* https://gist.github.com/roxlu/1c1af99f92bafff9d8d9 */

Expand Down Expand Up @@ -113,6 +114,30 @@ void rc_mutex_unlock(rc_mutex_t* mutex)
ReleaseMutex(mutex->handle);
}

#elif defined(GEKKO)

/* https://github.com/libretro/RetroArch/pull/16116 */

void rc_mutex_init(rc_mutex_t* mutex)
{
LWP_MutexInit(mutex, NULL);
}

void rc_mutex_destroy(rc_mutex_t* mutex)
{
LWP_MutexDestroy(mutex);
}

void rc_mutex_lock(rc_mutex_t* mutex)
{
LWP_MutexLock(mutex);
}

void rc_mutex_unlock(rc_mutex_t* mutex)
{
LWP_MutexUnlock(mutex);
}

#else

void rc_mutex_init(rc_mutex_t* mutex)
Expand Down

0 comments on commit 08c4118

Please sign in to comment.