summaryrefslogtreecommitdiff
path: root/TSRM
diff options
context:
space:
mode:
authorKalle Sommer Nielsen <kalle@php.net>2017-08-29 22:03:56 +0200
committerKalle Sommer Nielsen <kalle@php.net>2017-08-29 22:03:56 +0200
commitd3bc8beb4ff9e00c3742ada32788239c3f7988e0 (patch)
treeb0a1a030e505855433acb351468c3f72c1f67a88 /TSRM
parent63ea681417a7725f96df62739398cd4b8b05ba31 (diff)
downloadphp-git-d3bc8beb4ff9e00c3742ada32788239c3f7988e0.tar.gz
Removed support for BeOS, development for BeOS was supported 17 years ago.
This patch however does not drop support for the BeOS compatible variant, Haiku, see Github PR #2697 which is currently a WiP I intentionally left out some fragments for BeOS in the build system for that seems to be bundles
Diffstat (limited to 'TSRM')
-rw-r--r--TSRM/TSRM.c24
-rw-r--r--TSRM/TSRM.h7
-rw-r--r--TSRM/threads.m481
-rw-r--r--TSRM/tsrm.m418
4 files changed, 45 insertions, 85 deletions
diff --git a/TSRM/TSRM.c b/TSRM/TSRM.c
index cf72aad70e..aff1cef84e 100644
--- a/TSRM/TSRM.c
+++ b/TSRM/TSRM.c
@@ -110,11 +110,6 @@ static DWORD tls_key;
# define tsrm_tls_set(what) TlsSetValue(tls_key, (void*)(what))
# define tsrm_tls_get() TlsGetValue(tls_key)
-#elif defined(BETHREADS)
-static int32 tls_key;
-# define tsrm_tls_set(what) tls_set(tls_key, (void*)(what))
-# define tsrm_tls_get() (tsrm_tls_entry*)tls_get(tls_key)
-
#else
# define tsrm_tls_set(what)
# define tsrm_tls_get() NULL
@@ -135,8 +130,6 @@ TSRM_API int tsrm_startup(int expected_threads, int expected_resources, int debu
st_key_create(&tls_key, 0);
#elif defined(TSRM_WIN32)
tls_key = TlsAlloc();
-#elif defined(BETHREADS)
- tls_key = tls_allocate();
#endif
/* ensure singleton */
@@ -587,8 +580,6 @@ TSRM_API THREAD_T tsrm_thread_id(void)
return pthread_self();
#elif defined(TSRM_ST)
return st_thread_self();
-#elif defined(BETHREADS)
- return find_thread(NULL);
#endif
}/*}}}*/
@@ -608,10 +599,6 @@ TSRM_API MUTEX_T tsrm_mutex_alloc(void)
pthread_mutex_init(mutexp,NULL);
#elif defined(TSRM_ST)
mutexp = st_mutex_new();
-#elif defined(BETHREADS)
- mutexp = (beos_ben*)malloc(sizeof(beos_ben));
- mutexp->ben = 0;
- mutexp->sem = create_sem(1, "PHP sempahore");
#endif
#ifdef THR_DEBUG
printf("Mutex created thread: %d\n",mythreadid());
@@ -634,9 +621,6 @@ TSRM_API void tsrm_mutex_free(MUTEX_T mutexp)
free(mutexp);
#elif defined(TSRM_ST)
st_mutex_destroy(mutexp);
-#elif defined(BETHREADS)
- delete_sem(mutexp->sem);
- free(mutexp);
#endif
}
#ifdef THR_DEBUG
@@ -664,10 +648,6 @@ TSRM_API int tsrm_mutex_lock(MUTEX_T mutexp)
return pthread_mutex_lock(mutexp);
#elif defined(TSRM_ST)
return st_mutex_lock(mutexp);
-#elif defined(BETHREADS)
- if (atomic_add(&mutexp->ben, 1) != 0)
- return acquire_sem(mutexp->sem);
- return 0;
#endif
}/*}}}*/
@@ -691,10 +671,6 @@ TSRM_API int tsrm_mutex_unlock(MUTEX_T mutexp)
return pthread_mutex_unlock(mutexp);
#elif defined(TSRM_ST)
return st_mutex_unlock(mutexp);
-#elif defined(BETHREADS)
- if (atomic_add(&mutexp->ben, -1) != 1)
- return release_sem(mutexp->sem);
- return 0;
#endif
}/*}}}*/
diff --git a/TSRM/TSRM.h b/TSRM/TSRM.h
index 2177e924c9..15ebcd7949 100644
--- a/TSRM/TSRM.h
+++ b/TSRM/TSRM.h
@@ -72,13 +72,6 @@ typedef int ts_rsrc_id;
#elif defined(TSRM_ST)
# define THREAD_T st_thread_t
# define MUTEX_T st_mutex_t
-#elif defined(BETHREADS)
-# define THREAD_T thread_id
-typedef struct {
- sem_id sem;
- int32 ben;
-} beos_ben;
-# define MUTEX_T beos_ben *
#endif
#ifdef HAVE_SIGNAL_H
diff --git a/TSRM/threads.m4 b/TSRM/threads.m4
index 57b46f251a..efd8ee4e64 100644
--- a/TSRM/threads.m4
+++ b/TSRM/threads.m4
@@ -103,52 +103,47 @@ dnl -threads gcc (HP-UX)
dnl
AC_DEFUN([PTHREADS_CHECK],[
-if test "$beos_threads" = "1"; then
- pthreads_working="yes"
- ac_cv_pthreads_cflags=""
-else
- save_CFLAGS=$CFLAGS
- save_LIBS=$LIBS
- PTHREADS_ASSIGN_VARS
- PTHREADS_CHECK_COMPILE
- LIBS=$save_LIBS
- CFLAGS=$save_CFLAGS
+save_CFLAGS=$CFLAGS
+save_LIBS=$LIBS
+PTHREADS_ASSIGN_VARS
+PTHREADS_CHECK_COMPILE
+LIBS=$save_LIBS
+CFLAGS=$save_CFLAGS
- AC_CACHE_CHECK(for pthreads_cflags,ac_cv_pthreads_cflags,[
- ac_cv_pthreads_cflags=
- if test "$pthreads_working" != "yes"; then
- for flag in -kthread -pthread -pthreads -mthreads -Kthread -threads -mt -qthreaded; do
- ac_save=$CFLAGS
- CFLAGS="$CFLAGS $flag"
- PTHREADS_CHECK_COMPILE
- CFLAGS=$ac_save
- if test "$pthreads_checked" = "yes"; then
- ac_cv_pthreads_cflags=$flag
- break
- fi
- done
- fi
- ])
+AC_CACHE_CHECK(for pthreads_cflags,ac_cv_pthreads_cflags,[
+ac_cv_pthreads_cflags=
+if test "$pthreads_working" != "yes"; then
+ for flag in -kthread -pthread -pthreads -mthreads -Kthread -threads -mt -qthreaded; do
+ ac_save=$CFLAGS
+ CFLAGS="$CFLAGS $flag"
+ PTHREADS_CHECK_COMPILE
+ CFLAGS=$ac_save
+ if test "$pthreads_checked" = "yes"; then
+ ac_cv_pthreads_cflags=$flag
+ break
+ fi
+ done
+fi
+])
- AC_CACHE_CHECK(for pthreads_lib, ac_cv_pthreads_lib,[
- ac_cv_pthreads_lib=
- if test "$pthreads_working" != "yes"; then
- for lib in pthread pthreads c_r; do
- ac_save=$LIBS
- LIBS="$LIBS -l$lib"
- PTHREADS_CHECK_COMPILE
- LIBS=$ac_save
- if test "$pthreads_checked" = "yes"; then
- ac_cv_pthreads_lib=$lib
- break
- fi
- done
- fi
- ])
+AC_CACHE_CHECK(for pthreads_lib, ac_cv_pthreads_lib,[
+ac_cv_pthreads_lib=
+if test "$pthreads_working" != "yes"; then
+ for lib in pthread pthreads c_r; do
+ ac_save=$LIBS
+ LIBS="$LIBS -l$lib"
+ PTHREADS_CHECK_COMPILE
+ LIBS=$ac_save
+ if test "$pthreads_checked" = "yes"; then
+ ac_cv_pthreads_lib=$lib
+ break
+ fi
+ done
+fi
+])
- if test "x$ac_cv_pthreads_cflags" != "x" -o "x$ac_cv_pthreads_lib" != "x"; then
- pthreads_working="yes"
- fi
+if test "x$ac_cv_pthreads_cflags" != "x" -o "x$ac_cv_pthreads_lib" != "x"; then
+ pthreads_working="yes"
fi
if test "$pthreads_working" = "yes"; then
diff --git a/TSRM/tsrm.m4 b/TSRM/tsrm.m4
index 98aa2b8c91..ea9f9a0da1 100644
--- a/TSRM/tsrm.m4
+++ b/TSRM/tsrm.m4
@@ -77,19 +77,15 @@ sinclude(threads.m4)
AC_DEFUN([TSRM_CHECK_PTHREADS],[
PTHREADS_CHECK
+
+if test "$pthreads_working" != "yes"; then
+ AC_MSG_ERROR(Your system seems to lack POSIX threads.)
+fi
-if test "$beos_threads" = "1"; then
- AC_DEFINE(BETHREADS, 1, Whether to use native BeOS threads)
-else
- if test "$pthreads_working" != "yes"; then
- AC_MSG_ERROR(Your system seems to lack POSIX threads.)
- fi
-
- AC_DEFINE(PTHREADS, 1, Whether to use Pthreads)
+AC_DEFINE(PTHREADS, 1, Whether to use Pthreads)
- AC_MSG_CHECKING(for POSIX threads)
- AC_MSG_RESULT(yes)
-fi
+AC_MSG_CHECKING(for POSIX threads)
+AC_MSG_RESULT(yes)
])
AC_DEFUN([TSRM_THREADS_CHECKS],[