summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2007-05-27 16:59:34 +0000
committerLennart Poettering <lennart@poettering.net>2007-05-27 16:59:34 +0000
commit6a2dffd78af88ec3c3089c3a852af6d3a6b499bf (patch)
treea87025ee89048bcc6164bf40921bd9bc67b2ec4b
parent872018efc855e8ea7f3277d1e08c855c63c96897 (diff)
unfortunately we cannot detect if a foreign thread is still running. Thus sucks. But what can we do? U. Drepper thinks our use case is invalid.
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1458 fefdeb5f-60dc-0310-8127-8f9354f1896f
-rw-r--r--src/pulsecore/thread-posix.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/pulsecore/thread-posix.c b/src/pulsecore/thread-posix.c
index 7ff5e7c3..b3274426 100644
--- a/src/pulsecore/thread-posix.c
+++ b/src/pulsecore/thread-posix.c
@@ -111,17 +111,12 @@ pa_thread* pa_thread_new(pa_thread_func_t thread_func, void *userdata) {
int pa_thread_is_running(pa_thread *t) {
assert(t);
-
- if (!t->thread_func) {
- /* Mhmm, this is a foreign thread, t->running is not
- * necessarily valid. We misuse pthread_getschedparam() to
- * check if the thread is valid. This might not be portable. */
-
- int policy;
- struct sched_param param;
-
- return pthread_getschedparam(t->id, &policy, &param) >= 0 || errno != ESRCH;
- }
+
+ /* Unfortunately there is no way to tell whether a "foreign"
+ * thread is still running. See
+ * http://udrepper.livejournal.com/16844.html for more
+ * information */
+ assert(t->thread_func);
return pa_atomic_load(&t->running) > 0;
}