genode/repos/libports
Christian Helmuth abefca500b libc: fix deadlock in pthread_cond_timedwait/signal()
The deadlock occured with three concurrently running threads: two
waiters calling pthread_cond_timedwait() and one signaller calling
pthread_cond_signal().

If waiter W1 hits its timeout, the signaller may have called
pthread_cond_signal(), detected this waiter and posted the internal
'signal_sem' concurrently. Then, the signaller waits for 'handshake_sem'
to ensure the waiter got woken up.

Waiter W1 can't consume the 'signal_sem' post by
'sem_wait(&c->signal_sem)' because another waiter W2 may have consumed
the post already above in sem_wait/timedwait(). Waiting for a post on
'signal_sem' would block the waiter W1 in perfect deadlock with
signaller on 'handshake_sem'. As W1 also owns 'counter_mutex' in this
situation, waiter W2 would block when trying to aquire 'counter_mutex'
and can't resolve the situation.

So, W1 does nothing in this case and we accept the spurious wakeup on
next pthread_cond_wait/timedwait().
2020-10-09 13:35:56 +02:00
..
doc tool: remove deprecated 'make prepare' mechanism 2016-03-17 17:02:04 +01:00
include timeout: rework timeout framework 2020-10-09 13:35:56 +02:00
lib libc: update status for component select handlers 2020-10-09 13:35:56 +02:00
ports libc: provide 'sys/soundcard.h' header file 2020-10-09 13:33:35 +02:00
recipes depot: update recipe hashes 2020-09-18 14:04:56 +02:00
run Replace remaining 'constrain_phys' by 'managing_system' 2020-08-28 08:28:13 +02:00
src libc: fix deadlock in pthread_cond_timedwait/signal() 2020-10-09 13:35:56 +02:00
README README update 2016-08-30 17:24:00 +02:00

This directory contains ports of popular 3rd-party software to Genode.


Usage
-----

The tool './tool/ports/prepare_port' in the toplevel directory automates the
task of downloading and preparing the library source codes. You can select
individual packages that have to be prepared by specifying their base names
(without the version number) as command-line argument. For example, the
following command prepares both the C library and the Freetype library:
! ./tool/ports/prepare_port libc freetype

To compile and link against 3rd-party libraries of the 'libports' repository,
you have to include the repository into the build process by appending it to the
'REPOSITORIES' declaration of your '<build-dir>/etc/build.conf' file.


Under the hood
--------------

For each library, there is a file contained in the 'libports/ports/'
subdirectory. The file is named after the library and contains the
library-specific rules for downloading the source code and installing header
files.


How does 'libports' relate to the other repositories?
-----------------------------------------------------

Most libraries hosted in the 'libports' repository expect a complete C library,
which is provided with the 'libc' package. Please do not forget to prepare the
libc package when using any of the other libports packages. The libc, in turn,
depends on the 'os' repository for its back end. Because the 'os' repository is
the home of the dynamic linker, libraries contained in 'libports' are safe to
assume the presence of the dynamic linker and, thus, should be built as shared
libraries.