Stefan Sperling
d8e2b3a78c
Fix undefined behaviour in pulseaudio --start.
...
Don't call pthread_join() to join a thread from a different
process than the thread was created in. Doing so can lead to
undefined behaviour.
On OpenBSD, the symptom was a pulseaudio process with a single
thread waiting forever for other threads to join. Since that
process also held the autospawn lock, starting new pulseaudio
processes with --start kept failing. The problem was analyzed
with help from Philip Guenther.
This patch adds a pa_thread_free_nojoin() function which can
be used to free resources for a thread without a join, as
suggested by Tanu Kaskinen.
See https://bugs.freedesktop.org/show_bug.cgi?id=71738
2013-11-22 17:31:11 +02:00
poljar (Damir Jelić)
d806b19714
Remove pa_bool_t and replace it with bool.
...
commands used for this (executed from the pulseaudio/src directory):
find . -regex '\(.*\.[hc]\|.*\.cc\|.*\.m4\)' -not -name 'macro.h' \
-a -not -name 'reserve.[ch]' -a -not -name 'reserve-monitor.[ch]' \
-a -not -name 'glib-mainloop.c' -a -not -name 'gkt-test.c' \
-a -not -name 'glib-mainloop.c' -a -not -name 'gkt-test.c' \
-a -not -name 'poll-win32.c' -a -not -name 'thread-win32.c' \
-a -not -name 'dllmain.c' -a -not -name 'gconf-helper.c' \
-exec sed -i -e 's/\bpa_bool_t\b/bool/g' \
-e 's/\bTRUE\b/true/g' -e 's/\bFALSE\b/false/g' {} \;
and:
sed -i -e '181,194!s/\bpa_bool_t\b/bool/' \
-e '181,194!s/\bTRUE\b/true/' -e \
'181,194!s/\bFALSE\b/false/' pulsecore/macro.h
2013-07-04 12:25:30 +03:00
Maarten Bosmans
dd9265ac78
Remove unnecessary #includes
2011-06-22 23:12:20 +01:00
Daniel Mack
2411d9accd
thread-posix: Use pthread_(get|set)name_np() if available
...
Newer generations of libpthread have functions to set and get the thread
names. If available, use them.
2011-04-23 18:23:37 +01:00
Lennart Poettering
cdc2769162
thread: name all threads so that the names appear in /proc/$PID/task/$TID/comm
2010-05-07 23:58:59 +02:00
Lennart Poettering
7f7455b1be
once: make once related variables volatile
2010-02-09 22:31:30 +00:00
Colin Guthrie
86dee05aec
Use LGPL 2.1 on all files previously using LGPL 2
2009-03-03 20:23:02 +00:00
Lennart Poettering
6df029a1b1
make sure we don't crash if pa_thread_join() is called more than once on the same pa_thread object
2008-08-08 22:31:24 +02:00
Lennart Poettering
8ae83d618e
get rid of svn $ keywords
2008-06-18 23:23:21 +03:00
Lennart Poettering
a67c21f093
merge 'lennart' branch back into trunk.
...
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1971 fefdeb5f-60dc-0310-8127-8f9354f1896f
2007-10-28 19:13:50 +00:00
Lennart Poettering
1e12e0ee8d
Kill spaces on EOL
...
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1465 fefdeb5f-60dc-0310-8127-8f9354f1896f
2007-05-29 17:24:48 +00:00
Lennart Poettering
6a2dffd78a
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
2007-05-27 16:59:34 +00:00
Pierre Ossman
06211b7c8f
Add copyright notices to all relevant files. (based on svn log)
...
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1426 fefdeb5f-60dc-0310-8127-8f9354f1896f
2007-02-13 15:35:19 +00:00
Pierre Ossman
521daf6f0a
Huge trailing whitespace cleanup. Let's keep the tree pure from here on,
...
mmmkay?
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1418 fefdeb5f-60dc-0310-8127-8f9354f1896f
2007-01-04 13:43:45 +00:00
Lennart Poettering
6d532029ea
update for newer APIs: replace direct usage of libatomic_ops by usage of our own atomic.h; remove pa_once implementation; always use our pa_once implementation instead of the POSIX version
...
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1386 fefdeb5f-60dc-0310-8127-8f9354f1896f
2006-09-09 22:59:17 +00:00
Lennart Poettering
6bbfb43f2a
add accessor functions for the userdata attached to a pa_thread object
...
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1371 fefdeb5f-60dc-0310-8127-8f9354f1896f
2006-09-04 22:15:15 +00:00
Lennart Poettering
3be920d9ae
fix pa_thread_is_running() for foreign threads; fix a memory leak for foreign threads
...
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1370 fefdeb5f-60dc-0310-8127-8f9354f1896f
2006-09-04 22:04:33 +00:00
Lennart Poettering
8e7c2a3b0c
make pa_thread_self() return a sensible pointer on foreign threads
...
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1368 fefdeb5f-60dc-0310-8127-8f9354f1896f
2006-09-04 21:28:34 +00:00
Pierre Ossman
647ef180c3
Fix call to pa_mutex_new().
...
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1358 fefdeb5f-60dc-0310-8127-8f9354f1896f
2006-09-01 19:06:44 +00:00
Pierre Ossman
f84c65ed86
Add pthread_once() equivalent support.
...
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1357 fefdeb5f-60dc-0310-8127-8f9354f1896f
2006-09-01 18:39:55 +00:00
Pierre Ossman
6e9706bcbc
Also wrap yield functionality so that it can be platform independent.
...
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1353 fefdeb5f-60dc-0310-8127-8f9354f1896f
2006-08-31 16:13:07 +00:00
Lennart Poettering
aee4a3738e
define AO_REQUIRE_CAS in the Makefile instead of each source file, effectively reversing r1348
...
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1351 fefdeb5f-60dc-0310-8127-8f9354f1896f
2006-08-31 15:20:43 +00:00
Lennart Poettering
2f6cc4f8fa
fix handling of "running" variable
...
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1349 fefdeb5f-60dc-0310-8127-8f9354f1896f
2006-08-30 17:12:35 +00:00
Pierre Ossman
ad0535beef
Add AO_REQUIRE_CAS as we do.
...
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1348 fefdeb5f-60dc-0310-8127-8f9354f1896f
2006-08-30 17:01:10 +00:00
Lennart Poettering
b2c341f935
add a threading primitive API
...
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1344 fefdeb5f-60dc-0310-8127-8f9354f1896f
2006-08-29 19:51:14 +00:00