KallistiOS icon indicating copy to clipboard operation
KallistiOS copied to clipboard

Added support for pthread_condattr_setclock()

Open gyrovorbis opened this issue 1 year ago • 2 comments

  • Added public and private unions for pthread_condattr_t.
  • Added attribute pointer to pthread_cond_t
  • Initialized pthread_condattr_t::clock_id to CLOCK_REALTIME by default
  • Implemented pthread_condattr_setclock() with support for CLOCK_MONOTONIC and CLOCK_REALTIME
  • Warezed darc's timing fixes for pthread_cond_timedwait()
  • Made pthread_cond_timedwait() respect the requested clock ID
  • Added all of @darcagn's other fixes for mutex and rwlock timed functions

@darcagn can you verify if this solves the same problem that changing the clock default to CLOCK_MONOTONIC did for you?

gyrovorbis avatar Apr 20 '24 05:04 gyrovorbis

To clarify, my issues didn't end up having to do with the clock type at all, so there's nothing in particular for me to test here.

But I still wanted to PR the clock type changes because offering support for CLOCK_MONOTONIC allows us to choose the better code path in the Rust standard library.

darcagn avatar Apr 26 '24 20:04 darcagn

@ljsebald Alrighty, fixed the stupid and bumped up the pthread_condattr_t's default size to 16. Ready for review (again). :)

gyrovorbis avatar Apr 30 '24 07:04 gyrovorbis