DescriptionAllow creating a NaClAppThread without creating a new host OS thread
Split the thread-launching part of NaClAppThreadMake() into a separate
function, NaClAppThreadSpawn().
This is intended so that an embedder of NaCl can run untrusted code
without the overhead of creating a new host OS thread. I have added
an example of this to tests/minnacl.
* This means that an embedder might leave NaClAppThread's "thread"
field uninitialized. I have added a "host_thread_is_defined" field
so that the thread suspension code doesn't use an undefined
"thread" value accidentally in this case, and so that NaClAppThread
is freed correctly if NaClThreadCtor() fails.
* Rename NaClAppThread's "thread" to "host_thread" for greppability.
* Rename NaClThreadLauncher() to NaClAppThreadLauncher() for
consistency.
* Split out NaClGetInitialStackTop() from NaClCreateMainThread() to
avoid duplicating its logic in the test.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3223
TEST=run_minnacl_test
Committed: https://src.chromium.org/viewvc/native_client?view=rev&revision=10475
Patch Set 1 #Patch Set 2 : Fix unit test #Patch Set 3 : Fix pointer conversion #Patch Set 4 : Add comments #
Total comments: 6
Patch Set 5 : Remove dead statement #
Total comments: 2
Patch Set 6 : Review: Add NACL_WUR #Messages
Total messages: 6 (0 generated)
|