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:
Ryan C. Gordon
2013-11-13 22:35:26 -05:00
parent 0e55f65eda
commit ee4465fe4f
13 changed files with 61 additions and 408 deletions

View File

@@ -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
}