Fixed bug #935
authorSam Lantinga <slouken@libsdl.org>
Sun, 24 Jan 2010 20:47:20 +0000
changeset 369647d923feedb0
parent 3695 f6a8be3fefa0
child 3697 f7b03b6838cb
Fixed bug #935

Patrice Mandin

Hello,

I originally added pth support for threads in SDL 1.2 because on the Atari
platform we did not have any thread library.

I think pth support could be removed from SDL 1.3 for two reasons:

- Atari platform removed

- pth does not provides real (preemptive) threads, because it is user space,
and expect the application to call one of its function to give CPU to another
thread. So it is not exactly useful for applications, that expect threads to
run simultaneously.
configure.in
include/SDL_config.h.in
src/SDL.c
src/thread/SDL_thread_c.h
src/thread/pth/SDL_syscond.c
src/thread/pth/SDL_sysmutex.c
src/thread/pth/SDL_sysmutex_c.h
src/thread/pth/SDL_systhread.c
src/thread/pth/SDL_systhread_c.h
src/timer/unix/SDL_systimer.c
     1.1 --- a/configure.in	Sun Jan 24 20:21:51 2010 +0000
     1.2 +++ b/configure.in	Sun Jan 24 20:47:20 2010 +0000
     1.3 @@ -1694,33 +1694,6 @@
     1.4      fi
     1.5  }
     1.6  
     1.7 -dnl See if we can use GNU pth library for threads
     1.8 -CheckPTH()
     1.9 -{
    1.10 -    dnl Check for pth support
    1.11 -    AC_ARG_ENABLE(pth,
    1.12 -AC_HELP_STRING([--enable-pth], [use GNU pth library for multi-threading [[default=yes]]]),
    1.13 -                  , enable_pth=yes)
    1.14 -    if test x$enable_threads = xyes -a x$enable_pth = xyes; then
    1.15 -        AC_PATH_PROG(PTH_CONFIG, pth-config, no)
    1.16 -        if test "$PTH_CONFIG" = "no"; then
    1.17 -            use_pth=no
    1.18 -        else
    1.19 -            use_pth=yes
    1.20 -        fi
    1.21 -        AC_MSG_CHECKING(pth)
    1.22 -        AC_MSG_RESULT($use_pth)
    1.23 -        if test "x$use_pth" = xyes; then
    1.24 -            AC_DEFINE(SDL_THREAD_PTH)
    1.25 -            SOURCES="$SOURCES $srcdir/src/thread/pth/*.c"
    1.26 -            SOURCES="$SOURCES $srcdir/src/thread/generic/SDL_syssem.c"
    1.27 -            SDL_CFLAGS="$SDL_CFLAGS `$PTH_CONFIG --cflags`"
    1.28 -            SDL_LIBS="$SDL_LIBS `$PTH_CONFIG --libs --all`"
    1.29 -            have_threads=yes
    1.30 -        fi
    1.31 -    fi
    1.32 -}
    1.33 -
    1.34  dnl See what type of thread model to use on Linux and Solaris
    1.35  CheckPTHREAD()
    1.36  {
    1.37 @@ -1892,8 +1865,6 @@
    1.38              SOURCES="$SOURCES $srcdir/src/thread/pthread/SDL_syscond.c"
    1.39  
    1.40              have_threads=yes
    1.41 -        else
    1.42 -            CheckPTH
    1.43          fi
    1.44      fi
    1.45  }
     2.1 --- a/include/SDL_config.h.in	Sun Jan 24 20:21:51 2010 +0000
     2.2 +++ b/include/SDL_config.h.in	Sun Jan 24 20:47:20 2010 +0000
     2.3 @@ -236,7 +236,6 @@
     2.4  /* Enable various threading systems */
     2.5  #undef SDL_THREAD_BEOS
     2.6  #undef SDL_THREAD_NDS
     2.7 -#undef SDL_THREAD_PTH
     2.8  #undef SDL_THREAD_PTHREAD
     2.9  #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX
    2.10  #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP
     3.1 --- a/src/SDL.c	Sun Jan 24 20:21:51 2010 +0000
     3.2 +++ b/src/SDL.c	Sun Jan 24 20:47:20 2010 +0000
     3.3 @@ -31,10 +31,6 @@
     3.4  #include "video/SDL_leaks.h"
     3.5  #endif
     3.6  
     3.7 -#if SDL_THREAD_PTH
     3.8 -#include <pth.h>
     3.9 -#endif
    3.10 -
    3.11  /* Initialization/Cleanup routines */
    3.12  #if !SDL_JOYSTICK_DISABLED
    3.13  extern int SDL_JoystickInit(void);
    3.14 @@ -152,12 +148,6 @@
    3.15  int
    3.16  SDL_Init(Uint32 flags)
    3.17  {
    3.18 -#if !SDL_THREADS_DISABLED && SDL_THREAD_PTH
    3.19 -    if (!pth_init()) {
    3.20 -        return -1;
    3.21 -    }
    3.22 -#endif
    3.23 -
    3.24      if (SDL_AssertionsInit() < 0) {
    3.25          return -1;
    3.26      }
    3.27 @@ -266,9 +256,6 @@
    3.28  
    3.29      SDL_AssertionsQuit();
    3.30  
    3.31 -#if !SDL_THREADS_DISABLED && SDL_THREAD_PTH
    3.32 -    pth_kill();
    3.33 -#endif
    3.34  #ifdef DEBUG_BUILD
    3.35      printf("[SDL_Quit] : Returning!\n");
    3.36      fflush(stdout);
     4.1 --- a/src/thread/SDL_thread_c.h	Sun Jan 24 20:21:51 2010 +0000
     4.2 +++ b/src/thread/SDL_thread_c.h	Sun Jan 24 20:47:20 2010 +0000
     4.3 @@ -31,8 +31,6 @@
     4.4  #include "beos/SDL_systhread_c.h"
     4.5  #elif SDL_THREAD_EPOC
     4.6  #include "epoc/SDL_systhread_c.h"
     4.7 -#elif SDL_THREAD_PTH
     4.8 -#include "pth/SDL_systhread_c.h"
     4.9  #elif SDL_THREAD_PTHREAD
    4.10  #include "pthread/SDL_systhread_c.h"
    4.11  #elif SDL_THREAD_SPROC
     5.1 --- a/src/thread/pth/SDL_syscond.c	Sun Jan 24 20:21:51 2010 +0000
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,173 +0,0 @@
     5.4 -/*
     5.5 -    SDL - Simple DirectMedia Layer
     5.6 -    Copyright (C) 1997-2009 Sam Lantinga
     5.7 -
     5.8 -    This library is free software; you can redistribute it and/or
     5.9 -    modify it under the terms of the GNU Lesser General Public
    5.10 -    License as published by the Free Software Foundation; either
    5.11 -    version 2.1 of the License, or (at your option) any later version.
    5.12 -
    5.13 -    This library is distributed in the hope that it will be useful,
    5.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    5.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    5.16 -    Lesser General Public License for more details.
    5.17 -
    5.18 -    You should have received a copy of the GNU Lesser General Public
    5.19 -    License along with this library; if not, write to the Free Software
    5.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    5.21 -
    5.22 -    Sam Lantinga
    5.23 -    slouken@libsdl.org
    5.24 -*/
    5.25 -#include "SDL_config.h"
    5.26 -
    5.27 -/*
    5.28 - *	GNU pth conditions variables
    5.29 - *
    5.30 - *	Patrice Mandin
    5.31 - */
    5.32 -
    5.33 -#include <pth.h>
    5.34 -
    5.35 -#include "SDL_thread.h"
    5.36 -#include "SDL_sysmutex_c.h"
    5.37 -
    5.38 -struct SDL_cond
    5.39 -{
    5.40 -    pth_cond_t condpth_p;
    5.41 -};
    5.42 -
    5.43 -/* Create a condition variable */
    5.44 -SDL_cond *
    5.45 -SDL_CreateCond(void)
    5.46 -{
    5.47 -    SDL_cond *cond;
    5.48 -
    5.49 -    cond = (SDL_cond *) SDL_malloc(sizeof(SDL_cond));
    5.50 -    if (cond) {
    5.51 -        if (pth_cond_init(&(cond->condpth_p)) < 0) {
    5.52 -            SDL_SetError("pthread_cond_init() failed");
    5.53 -            SDL_free(cond);
    5.54 -            cond = NULL;
    5.55 -        }
    5.56 -    } else {
    5.57 -        SDL_OutOfMemory();
    5.58 -    }
    5.59 -    return (cond);
    5.60 -}
    5.61 -
    5.62 -/* Destroy a condition variable */
    5.63 -void
    5.64 -SDL_DestroyCond(SDL_cond * cond)
    5.65 -{
    5.66 -    if (cond) {
    5.67 -        SDL_free(cond);
    5.68 -    }
    5.69 -}
    5.70 -
    5.71 -/* Restart one of the threads that are waiting on the condition variable */
    5.72 -int
    5.73 -SDL_CondSignal(SDL_cond * cond)
    5.74 -{
    5.75 -    int retval;
    5.76 -
    5.77 -    if (!cond) {
    5.78 -        SDL_SetError("Passed a NULL condition variable");
    5.79 -        return -1;
    5.80 -    }
    5.81 -
    5.82 -    retval = 0;
    5.83 -    if (pth_cond_notify(&(cond->condpth_p), FALSE) != 0) {
    5.84 -        SDL_SetError("pth_cond_notify() failed");
    5.85 -        retval = -1;
    5.86 -    }
    5.87 -    return retval;
    5.88 -}
    5.89 -
    5.90 -/* Restart all threads that are waiting on the condition variable */
    5.91 -int
    5.92 -SDL_CondBroadcast(SDL_cond * cond)
    5.93 -{
    5.94 -    int retval;
    5.95 -
    5.96 -    if (!cond) {
    5.97 -        SDL_SetError("Passed a NULL condition variable");
    5.98 -        return -1;
    5.99 -    }
   5.100 -
   5.101 -    retval = 0;
   5.102 -    if (pth_cond_notify(&(cond->condpth_p), TRUE) != 0) {
   5.103 -        SDL_SetError("pth_cond_notify() failed");
   5.104 -        retval = -1;
   5.105 -    }
   5.106 -    return retval;
   5.107 -}
   5.108 -
   5.109 -/* Wait on the condition variable for at most 'ms' milliseconds.
   5.110 -   The mutex must be locked before entering this function!
   5.111 -   The mutex is unlocked during the wait, and locked again after the wait.
   5.112 -
   5.113 -Typical use:
   5.114 -
   5.115 -Thread A:
   5.116 -	SDL_LockMutex(lock);
   5.117 -	while ( ! condition ) {
   5.118 -		SDL_CondWait(cond);
   5.119 -	}
   5.120 -	SDL_UnlockMutex(lock);
   5.121 -
   5.122 -Thread B:
   5.123 -	SDL_LockMutex(lock);
   5.124 -	...
   5.125 -	condition = true;
   5.126 -	...
   5.127 -	SDL_UnlockMutex(lock);
   5.128 - */
   5.129 -int
   5.130 -SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms)
   5.131 -{
   5.132 -    int retval;
   5.133 -    pth_event_t ev;
   5.134 -    int sec;
   5.135 -
   5.136 -    if (!cond) {
   5.137 -        SDL_SetError("Passed a NULL condition variable");
   5.138 -        return -1;
   5.139 -    }
   5.140 -
   5.141 -    retval = 0;
   5.142 -
   5.143 -    sec = ms / 1000;
   5.144 -    ev = pth_event(PTH_EVENT_TIME,
   5.145 -                   pth_timeout(sec, (ms - sec * 1000) * 1000));
   5.146 -
   5.147 -    if (pth_cond_await(&(cond->condpth_p), &(mutex->mutexpth_p), ev) != 0) {
   5.148 -        SDL_SetError("pth_cond_await() failed");
   5.149 -        retval = -1;
   5.150 -    }
   5.151 -
   5.152 -    pth_event_free(ev, PTH_FREE_ALL);
   5.153 -
   5.154 -    return retval;
   5.155 -}
   5.156 -
   5.157 -/* Wait on the condition variable forever */
   5.158 -int
   5.159 -SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex)
   5.160 -{
   5.161 -    int retval;
   5.162 -
   5.163 -    if (!cond) {
   5.164 -        SDL_SetError("Passed a NULL condition variable");
   5.165 -        return -1;
   5.166 -    }
   5.167 -
   5.168 -    retval = 0;
   5.169 -    if (pth_cond_await(&(cond->condpth_p), &(mutex->mutexpth_p), NULL) != 0) {
   5.170 -        SDL_SetError("pth_cond_await() failed");
   5.171 -        retval = -1;
   5.172 -    }
   5.173 -    return retval;
   5.174 -}
   5.175 -
   5.176 -/* vi: set ts=4 sw=4 expandtab: */
     6.1 --- a/src/thread/pth/SDL_sysmutex.c	Sun Jan 24 20:21:51 2010 +0000
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,93 +0,0 @@
     6.4 -/*
     6.5 -    SDL - Simple DirectMedia Layer
     6.6 -    Copyright (C) 1997-2009 Sam Lantinga
     6.7 -
     6.8 -    This library is free software; you can redistribute it and/or
     6.9 -    modify it under the terms of the GNU Lesser General Public
    6.10 -    License as published by the Free Software Foundation; either
    6.11 -    version 2.1 of the License, or (at your option) any later version.
    6.12 -
    6.13 -    This library is distributed in the hope that it will be useful,
    6.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    6.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    6.16 -    Lesser General Public License for more details.
    6.17 -
    6.18 -    You should have received a copy of the GNU Lesser General Public
    6.19 -    License along with this library; if not, write to the Free Software
    6.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    6.21 -
    6.22 -    Sam Lantinga
    6.23 -    slouken@libsdl.org
    6.24 -*/
    6.25 -#include "SDL_config.h"
    6.26 -
    6.27 -/*
    6.28 - *	GNU pth mutexes
    6.29 - *
    6.30 - *	Patrice Mandin
    6.31 - */
    6.32 -
    6.33 -#include <pth.h>
    6.34 -
    6.35 -#include "SDL_mutex.h"
    6.36 -#include "SDL_sysmutex_c.h"
    6.37 -
    6.38 -/* Create a mutex */
    6.39 -SDL_mutex *
    6.40 -SDL_CreateMutex(void)
    6.41 -{
    6.42 -    SDL_mutex *mutex;
    6.43 -
    6.44 -    /* Allocate mutex memory */
    6.45 -    mutex = (SDL_mutex *) SDL_malloc(sizeof(*mutex));
    6.46 -    if (mutex) {
    6.47 -        /* Create the mutex, with initial value signaled */
    6.48 -        if (!pth_mutex_init(&(mutex->mutexpth_p))) {
    6.49 -            SDL_SetError("Couldn't create mutex");
    6.50 -            SDL_free(mutex);
    6.51 -            mutex = NULL;
    6.52 -        }
    6.53 -    } else {
    6.54 -        SDL_OutOfMemory();
    6.55 -    }
    6.56 -    return (mutex);
    6.57 -}
    6.58 -
    6.59 -/* Free the mutex */
    6.60 -void
    6.61 -SDL_DestroyMutex(SDL_mutex * mutex)
    6.62 -{
    6.63 -    if (mutex) {
    6.64 -        SDL_free(mutex);
    6.65 -    }
    6.66 -}
    6.67 -
    6.68 -/* Lock the mutex */
    6.69 -int
    6.70 -SDL_mutexP(SDL_mutex * mutex)
    6.71 -{
    6.72 -    if (mutex == NULL) {
    6.73 -        SDL_SetError("Passed a NULL mutex");
    6.74 -        return -1;
    6.75 -    }
    6.76 -
    6.77 -    pth_mutex_acquire(&(mutex->mutexpth_p), FALSE, NULL);
    6.78 -
    6.79 -    return (0);
    6.80 -}
    6.81 -
    6.82 -/* Unlock the mutex */
    6.83 -int
    6.84 -SDL_mutexV(SDL_mutex * mutex)
    6.85 -{
    6.86 -    if (mutex == NULL) {
    6.87 -        SDL_SetError("Passed a NULL mutex");
    6.88 -        return -1;
    6.89 -    }
    6.90 -
    6.91 -    pth_mutex_release(&(mutex->mutexpth_p));
    6.92 -
    6.93 -    return (0);
    6.94 -}
    6.95 -
    6.96 -/* vi: set ts=4 sw=4 expandtab: */
     7.1 --- a/src/thread/pth/SDL_sysmutex_c.h	Sun Jan 24 20:21:51 2010 +0000
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,33 +0,0 @@
     7.4 -/*
     7.5 -    SDL - Simple DirectMedia Layer
     7.6 -    Copyright (C) 1997-2009 Sam Lantinga
     7.7 -
     7.8 -    This library is free software; you can redistribute it and/or
     7.9 -    modify it under the terms of the GNU Lesser General Public
    7.10 -    License as published by the Free Software Foundation; either
    7.11 -    version 2.1 of the License, or (at your option) any later version.
    7.12 -
    7.13 -    This library is distributed in the hope that it will be useful,
    7.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    7.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    7.16 -    Lesser General Public License for more details.
    7.17 -
    7.18 -    You should have received a copy of the GNU Lesser General Public
    7.19 -    License along with this library; if not, write to the Free Software
    7.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    7.21 -
    7.22 -    Sam Lantinga
    7.23 -    slouken@libsdl.org
    7.24 -*/
    7.25 -#include "SDL_config.h"
    7.26 -
    7.27 -#ifndef _SDL_SYSMUTEX_C_H_
    7.28 -#define _SDL_SYSMUTEX_C_H_
    7.29 -
    7.30 -struct SDL_mutex
    7.31 -{
    7.32 -    pth_mutex_t mutexpth_p;
    7.33 -};
    7.34 -
    7.35 -#endif /* _SDL_SYSMUTEX_C_H_ */
    7.36 -/* vi: set ts=4 sw=4 expandtab: */
     8.1 --- a/src/thread/pth/SDL_systhread.c	Sun Jan 24 20:21:51 2010 +0000
     8.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.3 @@ -1,103 +0,0 @@
     8.4 -/*
     8.5 -    SDL - Simple DirectMedia Layer
     8.6 -    Copyright (C) 1997-2009 Sam Lantinga
     8.7 -
     8.8 -    This library is free software; you can redistribute it and/or
     8.9 -    modify it under the terms of the GNU Lesser General Public
    8.10 -    License as published by the Free Software Foundation; either
    8.11 -    version 2.1 of the License, or (at your option) any later version.
    8.12 -
    8.13 -    This library is distributed in the hope that it will be useful,
    8.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    8.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    8.16 -    Lesser General Public License for more details.
    8.17 -
    8.18 -    You should have received a copy of the GNU Lesser General Public
    8.19 -    License along with this library; if not, write to the Free Software
    8.20 -    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    8.21 -
    8.22 -    Sam Lantinga
    8.23 -    slouken@libsdl.org
    8.24 -*/
    8.25 -#include "SDL_config.h"
    8.26 -
    8.27 -/*
    8.28 - *	GNU pth threads
    8.29 - *
    8.30 - *	Patrice Mandin
    8.31 - */
    8.32 -
    8.33 -#include <pth.h>
    8.34 -#include <signal.h>
    8.35 -
    8.36 -#include "SDL_thread.h"
    8.37 -#include "../SDL_thread_c.h"
    8.38 -#include "../SDL_systhread.h"
    8.39 -
    8.40 -/* List of signals to mask in the subthreads */
    8.41 -static int sig_list[] = {
    8.42 -    SIGHUP, SIGINT, SIGQUIT, SIGPIPE, SIGALRM, SIGTERM, SIGCHLD, SIGWINCH,
    8.43 -    SIGVTALRM, SIGPROF, 0
    8.44 -};
    8.45 -
    8.46 -static void *
    8.47 -RunThread(void *data)
    8.48 -{
    8.49 -    SDL_RunThread(data);
    8.50 -    pth_exit((void *) 0);
    8.51 -    return ((void *) 0);        /* Prevent compiler warning */
    8.52 -}
    8.53 -
    8.54 -int
    8.55 -SDL_SYS_CreateThread(SDL_Thread * thread, void *args)
    8.56 -{
    8.57 -    pth_attr_t type;
    8.58 -
    8.59 -    /* Create a new attribute */
    8.60 -    type = pth_attr_new();
    8.61 -    if (type == NULL) {
    8.62 -        SDL_SetError("Couldn't initialize pth attributes");
    8.63 -        return (-1);
    8.64 -    }
    8.65 -    pth_attr_set(type, PTH_ATTR_JOINABLE, TRUE);
    8.66 -
    8.67 -    /* Create the thread and go! */
    8.68 -    thread->handle = pth_spawn(type, RunThread, args);
    8.69 -    if (thread->handle == NULL) {
    8.70 -        SDL_SetError("Not enough resources to create thread");
    8.71 -        return (-1);
    8.72 -    }
    8.73 -    return (0);
    8.74 -}
    8.75 -
    8.76 -void
    8.77 -SDL_SYS_SetupThread(void)
    8.78 -{
    8.79 -    int i;
    8.80 -    sigset_t mask;
    8.81 -    int oldstate;
    8.82 -
    8.83 -    /* Mask asynchronous signals for this thread */
    8.84 -    sigemptyset(&mask);
    8.85 -    for (i = 0; sig_list[i]; ++i) {
    8.86 -        sigaddset(&mask, sig_list[i]);
    8.87 -    }
    8.88 -    pth_sigmask(SIG_BLOCK, &mask, 0);
    8.89 -
    8.90 -    /* Allow ourselves to be asynchronously cancelled */
    8.91 -    pth_cancel_state(PTH_CANCEL_ASYNCHRONOUS, &oldstate);
    8.92 -}
    8.93 -
    8.94 -SDL_threadID
    8.95 -SDL_ThreadID(void)
    8.96 -{
    8.97 -    return ((SDL_threadID) pth_self());
    8.98 -}
    8.99 -
   8.100 -void
   8.101 -SDL_SYS_WaitThread(SDL_Thread * thread)
   8.102 -{
   8.103 -    pth_join(thread->handle, NULL);
   8.104 -}
   8.105 -
   8.106 -/* vi: set ts=4 sw=4 expandtab: */
     9.1 --- a/src/thread/pth/SDL_systhread_c.h	Sun Jan 24 20:21:51 2010 +0000
     9.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 @@ -1,32 +0,0 @@
     9.4 -/*
     9.5 -    SDL - Simple DirectMedia Layer
     9.6 -    Copyright (C) 1997-2009 Sam Lantinga
     9.7 -
     9.8 -    This library is free software; you can redistribute it and/or
     9.9 -    modify it under the terms of the GNU Library General Public
    9.10 -    License as published by the Free Software Foundation; either
    9.11 -    version 2 of the License, or (at your option) any later version.
    9.12 -
    9.13 -    This library is distributed in the hope that it will be useful,
    9.14 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
    9.15 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    9.16 -    Library General Public License for more details.
    9.17 -
    9.18 -    You should have received a copy of the GNU Library General Public
    9.19 -    License along with this library; if not, write to the Free
    9.20 -    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    9.21 -
    9.22 -    Sam Lantinga
    9.23 -    slouken@libsdl.org
    9.24 -*/
    9.25 -#include "SDL_config.h"
    9.26 -
    9.27 -#ifndef _SDL_SYSTHREAD_C_H_
    9.28 -#define _SDL_SYSTHREAD_C_H_
    9.29 -
    9.30 -#include <pth.h>
    9.31 -
    9.32 -typedef pth_t SYS_ThreadHandle;
    9.33 -
    9.34 -#endif /* _SDL_SYSTHREAD_C_H_ */
    9.35 -/* vi: set ts=4 sw=4 expandtab: */
    10.1 --- a/src/timer/unix/SDL_systimer.c	Sun Jan 24 20:21:51 2010 +0000
    10.2 +++ b/src/timer/unix/SDL_systimer.c	Sun Jan 24 20:47:20 2010 +0000
    10.3 @@ -42,10 +42,6 @@
    10.4  #include <time.h>
    10.5  #endif
    10.6  
    10.7 -#if SDL_THREAD_PTH
    10.8 -#include <pth.h>
    10.9 -#endif
   10.10 -
   10.11  #if SDL_THREADS_DISABLED
   10.12  #define USE_ITIMER
   10.13  #endif
   10.14 @@ -94,12 +90,6 @@
   10.15  void
   10.16  SDL_Delay(Uint32 ms)
   10.17  {
   10.18 -#if SDL_THREAD_PTH
   10.19 -    pth_time_t tv;
   10.20 -    tv.tv_sec = ms / 1000;
   10.21 -    tv.tv_usec = (ms % 1000) * 1000;
   10.22 -    pth_nap(tv);
   10.23 -#else
   10.24      int was_error;
   10.25  
   10.26  #if HAVE_NANOSLEEP
   10.27 @@ -138,7 +128,6 @@
   10.28          was_error = select(0, NULL, NULL, NULL, &tv);
   10.29  #endif /* HAVE_NANOSLEEP */
   10.30      } while (was_error && (errno == EINTR));
   10.31 -#endif /* SDL_THREAD_PTH */
   10.32  }
   10.33  
   10.34  #ifdef USE_ITIMER