Chromium Code Reviews
DescriptionThread suspension: Implement for Linux
Linux doesn't have an equivalent of Windows's SuspendThread() call for
suspending individual threads (except for ptrace(), which we can't
readily use inside Chromium's outer sandbox), so we use an
asynchronous signal to interrupt and suspend a thread.
For speed and simplicity, and to avoid deadlocks in the signal
handler, we use Linux futexes for the synchronisation.
Since NaClAppThreadSetSuspendState() now has multiple implementations,
it moves into the OS-specific files. Add a "generic" directory for
the non-OS-specific no-op implementation.
Add an implementation of NaClTlsGetIdx() for x86-32 Linux that mirrors
the x86-64 equivalent so that we can get the interrupted thread's
identity inside the signal handler.
This is intended for use by the debug stub. However, it does not save
registers yet. This just implements for Linux what we already have
for Windows.
BUG=http://code.google.com/p/nativeclient/issues/detail?id=2758
TEST=run_thread_suspension_test
Committed: https://src.chromium.org/viewvc/native_client?view=rev&revision=8670
Patch Set 1 #Patch Set 2 : Switch to using futexes #Patch Set 3 : Fix build #Patch Set 4 : Fix tests #Patch Set 5 : Cleanup #Patch Set 6 : Fix #if #Patch Set 7 : Rebase; comment; fix QEMU disabling #Patch Set 8 : Use %d #
Total comments: 20
Patch Set 9 : Comments #Patch Set 10 : Tweaks #Patch Set 11 : Use private futexes #
Total comments: 1
Patch Set 12 : Comment about docs #Messages
Total messages: 7 (0 generated)
|