scePthreadCondInit ignores its name and nothing reads a condition variable name back, so pthread_cond_setname_np now only validates the condition variable and the name. Drops the stale libkernel_sys declaration and moves the debt entry to Silent stubs, citing shadPS4.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Store the name on the condition variable, creating a statically initialized one first, and return EINVAL for a destroyed one. A null cond or a null name throws, recorded in the libkernel debt file.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Main's #9573 implements scePthreadResume right after the
scePthreadMutexattrSetkind stub this branch removes from libkernel_sys;
the merge takes main's scePthreadResume and leaves the stub out.
Main's public-header audit wants one header declaration per export, so
the merge declares this branch's scePthreadMutexattrSetkind,
scePthreadMutexattrGetkind and pthread_rwlockattr_settype_np in
libkernel's Api.hpp, drops their stub declarations from libkernel_sys's
Api.hpp, has Mutex.cpp take sceKernelError from libkernel's Api.hpp,
and has the test include the libkernel headers instead of its own
declarations.
Implement pthread_attr_setcreatesuspend_np, pthread_resume_np,
pthread_resume_all_np and pthread_multi_np with the sce forms
scePthreadAttrSetcreatesuspend, scePthreadResume, scePthreadResumeAll
and scePthreadMulti, following FreeBSD 11.4 libthr and the firmware
13.42 libkernel_sys module. A thread created suspended waits before its
start routine, outside any cancellation point, until it is resumed.
sceKernelRaiseException throws on Windows for a thread still suspended
at creation.
AppKit, which SDL uses for windows, Metal surfaces, event pumping and game
controllers, works only on the main thread, and a guest never hands its
thread back. The macOS relinker emits a call to Aps5StartGuest as the
entry of a relinked executable; no library provided it.
- Aps5StartGuest runs the guest entry on a new thread with the stack size
of the main thread (at least 8 MiB) and serves the main dispatch queue
from the run loop of the main thread. The guest ends the process with
exit; a guest entry that returns aborts.
- Aps5RunOnMainThread runs a function on the main thread and waits for it,
or in place where the main thread is the caller or Aps5StartGuest was
never called.
- libSceVideoOut sends its SDL calls through OnMainThread, which carries
the exceptions back to the caller: the initialisation and shutdown of the
video and game controller subsystems, the window, its Vulkan surface and
drawable size, the event polling and the pad, mouse and keyboard input,
which are created and destroyed there. On the other platforms the
functions run in place.
- The flip test starts its tests through Aps5StartGuest on macOS, as a
relinked guest does.
Co-authored-by: mugurc <[email protected]>
scePthreadMutexTimedlock on a mutex the caller holds, and
scePthreadRwlockTimedrdlock and scePthreadRwlockTimedwrlock on a rwlock
it holds for writing, returned EDEADLK at once. The console returns
ETIMEDOUT, as the prosper console oracle measured. They now sleep until
the timeout and return ETIMEDOUT, as FreeBSD libthr does. The POSIX
timed locks call these and change with them.
Co-Authored-By: Claude Opus 5.5 <[email protected]>