mirror of
https://github.com/yawut/SDL.git
synced 2026-09-08 17:16:19 -05:00
Started BeOS removal: merged BeOS thread and pthread code.
Haiku uses most of the standard pthread API, with a few #ifdefs where we still need to fallback onto the old BeOS APIs. BeOS, however, does not support pthreads (or maybe doesn't support it well), so I'm unplugging support for the platform with this changeset. Be Inc went out of business in 2001.
This commit is contained in:
@@ -51,6 +51,10 @@
|
||||
#include "../../core/android/SDL_android.h"
|
||||
#endif
|
||||
|
||||
#ifdef __HAIKU__
|
||||
#include <be/kernel/OS.h>
|
||||
#endif
|
||||
|
||||
#include "SDL_assert.h"
|
||||
|
||||
/* List of signals to mask in the subthreads */
|
||||
@@ -59,7 +63,6 @@ static const int sig_list[] = {
|
||||
SIGVTALRM, SIGPROF, 0
|
||||
};
|
||||
|
||||
|
||||
static void *
|
||||
RunThread(void *data)
|
||||
{
|
||||
@@ -129,6 +132,12 @@ SDL_SYS_SetupThread(const char *name)
|
||||
pthread_setname_np(pthread_self(), name);
|
||||
#elif HAVE_PTHREAD_SET_NAME_NP
|
||||
pthread_set_name_np(pthread_self(), name);
|
||||
#elif defined(__HAIKU__)
|
||||
/* The docs say the thread name can't be longer than B_OS_NAME_LENGTH. */
|
||||
char namebuf[B_OS_NAME_LENGTH];
|
||||
SDL_snprintf(namebuf, sizeof (namebuf), "%s", name);
|
||||
namebuf[sizeof (namebuf) - 1] = '\0';
|
||||
rename_thread(find_thread(NULL), namebuf);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user