Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(215)

Issue 2659002: Remove thread refcount and remove NaClAppDtor() (Closed)

Created:
10 years, 6 months ago by Mark Seaborn
Modified:
9 years, 5 months ago
Reviewers:
Cliff L. Biffle
CC:
native-client-reviews_googlegroups.com
Visibility:
Public.

Description

Remove thread refcount and remove NaClAppDtor() Following r2358, where support for signal stacks was added, NaClAppThreadDtor() must now be called from the thread that is shutting down, or the signal stack will be unregistered for the wrong thread. This means the refcount for threads should be removed, to ensure that it is not used unsafely, so remove NaClAppThreadIncRef() (which was not used anyway) and remove NaClAppThreadDecRef(). NaClAppDtor() called NaClAppThreadDecRef() but is basically unused, because it is not able to shut down running threads safely. There is a TODO for its removal, so remove it. This leaves other code unused, so remove it too: * NaClAppFreeAllMemory() * NaClAppFreeWalker() * NaClTeardownMprotectGuards() * guard_pages_initialized field web_worker_stub.c called NaClAppDtor() but is dead code. BUG=http://code.google.com/p/nativeclient/issues/detail?id=560 TEST=existing tests Committed: http://code.google.com/p/nativeclient/source/detail?r=2458

Patch Set 1 #

Patch Set 2 : Fix Gyp build #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -326 lines) Patch
M src/native_client/src/trusted/service_runtime/arch/arm/sel_addrspace_arm.c View 1 chunk +0 lines, -15 lines 0 comments Download
M src/native_client/src/trusted/service_runtime/arch/x86_32/sel_addrspace_x86_32.c View 1 chunk +0 lines, -5 lines 0 comments Download
M src/native_client/src/trusted/service_runtime/arch/x86_64/sel_addrspace_x86_64.c View 1 chunk +0 lines, -19 lines 0 comments Download
M src/native_client/src/trusted/service_runtime/build.scons View 1 chunk +0 lines, -1 line 0 comments Download
M src/native_client/src/trusted/service_runtime/mmap_test.c View 1 chunk +0 lines, -1 line 0 comments Download
M src/native_client/src/trusted/service_runtime/nacl_app_thread.h View 2 chunks +0 lines, -6 lines 0 comments Download
M src/native_client/src/trusted/service_runtime/nacl_app_thread.c View 2 chunks +0 lines, -33 lines 0 comments Download
M src/native_client/src/trusted/service_runtime/nacl_syscall_common.c View 1 chunk +2 lines, -2 lines 0 comments Download
M src/native_client/src/trusted/service_runtime/sel_addrspace.h View 1 chunk +1 line, -4 lines 0 comments Download
M src/native_client/src/trusted/service_runtime/sel_addrspace.c View 1 chunk +0 lines, -1 line 0 comments Download
M src/native_client/src/trusted/service_runtime/sel_ldr.h View 2 chunks +0 lines, -19 lines 0 comments Download
M src/native_client/src/trusted/service_runtime/sel_ldr.c View 3 chunks +0 lines, -208 lines 0 comments Download
M src/native_client/src/trusted/service_runtime/sel_ldr_test.cc View 3 chunks +0 lines, -9 lines 1 comment Download
M src/native_client/src/trusted/service_runtime/sel_main.c View 1 chunk +0 lines, -2 lines 0 comments Download
M src/native_client/src/trusted/service_runtime/service_runtime.gyp View 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 3 (0 generated)
Mark Seaborn
I could split this up into a couple of commits, but the review process/tools seem ...
10 years, 6 months ago (2010-06-04 14:54:12 UTC) #1
Cliff L. Biffle
LGTM. Woooooooooooooooooo! http://codereview.chromium.org/2659002/diff/2001/3013 File src/native_client/src/trusted/service_runtime/sel_ldr_test.cc (left): http://codereview.chromium.org/2659002/diff/2001/3013#oldcode83 src/native_client/src/trusted/service_runtime/sel_ldr_test.cc:83: NaClAppDtor(&app); Hm, tests are actually the one ...
10 years, 6 months ago (2010-06-08 00:14:24 UTC) #2
Mark Seaborn
10 years, 6 months ago (2010-06-08 17:50:43 UTC) #3
On 2010/06/08 00:14:24, Cliff L. Biffle wrote:
> LGTM.  Woooooooooooooooooo!
> 
> http://codereview.chromium.org/2659002/diff/2001/3013
> File src/native_client/src/trusted/service_runtime/sel_ldr_test.cc (left):
> 
> http://codereview.chromium.org/2659002/diff/2001/3013#oldcode83
> src/native_client/src/trusted/service_runtime/sel_ldr_test.cc:83:
> NaClAppDtor(&app);

> Hm, tests are actually the one context where I'd expect the Dtor to
> be useful!  Does this test still pass?

Yep, it still passes.  I guess it's just leaking a small amount of
space between test cases, which I think is fine for a test.

Thanks,
Mark

Powered by Google App Engine
This is Rietveld 408576698