summaryrefslogtreecommitdiffstats
path: root/old-makefile
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-07-26 20:29:48 +0200
committerwm4 <wm4@nowhere>2014-07-26 20:29:48 +0200
commit559fe1daace8f48a8dc37906f840e9981b961415 (patch)
tree35f892f0126dc112c2af36080b0a0a5e1d70b597 /old-makefile
parent8ed6d298c5dba49bd4f1e5dc877fcd67652123b2 (diff)
downloadmpv-559fe1daace8f48a8dc37906f840e9981b961415.tar.bz2
mpv-559fe1daace8f48a8dc37906f840e9981b961415.tar.xz
Add Plan 9-style barriers
Plan 9 has a very interesting synchronization mechanism, the rendezvous() call. A good property of this is that you don't need to explicitly initialize and destroy a barrier object, unlike as with e.g. POSIX barriers (which are mandatory to begin with). Upon "meeting", they can exchange a value. This mechanism will be nice to synchronize certain stages of initialization between threads in the following commit. Unlike Plan 9 rendezvous(), this is not implemented with a hashtable, because that would require additional effort (especially if you want to make it actually scele). Unlike the Plan 9 variant, we use intptr_t instead of void* as type for the value, because I expect that we will be mostly passing a status code as value and not a pointer. Converting an integer to void* requires two cast (because the integer needs to be intptr_t), the other way around it's only one cast. We don't particularly care about performance in this case either. It's simply not important for our use-case. So a simple linked list is used for waiters, and on wakeup, all waiters are temporarily woken up.
Diffstat (limited to 'old-makefile')
-rw-r--r--old-makefile1
1 files changed, 1 insertions, 0 deletions
diff --git a/old-makefile b/old-makefile
index c5d8e6a223..a1d98e60ec 100644
--- a/old-makefile
+++ b/old-makefile
@@ -177,6 +177,7 @@ SOURCES = audio/audio.c \
input/keycodes.c \
misc/charset_conv.c \
misc/dispatch.c \
+ misc/rendezvous.c \
misc/ring.c \
options/m_config.c \
options/m_option.c \