Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2012 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 #include "native_client/src/trusted/service_runtime/nacl_secure_service.h" | 7 #include "native_client/src/trusted/service_runtime/nacl_secure_service.h" |
| 8 | 8 |
| 9 #include "native_client/src/shared/platform/nacl_exit.h" | 9 #include "native_client/src/shared/platform/nacl_exit.h" |
| 10 #include "native_client/src/shared/platform/nacl_log.h" | 10 #include "native_client/src/shared/platform/nacl_log.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 93 static void NaClSecureServiceConnectionCountDecr( | 93 static void NaClSecureServiceConnectionCountDecr( |
| 94 struct NaClSecureService *self) { | 94 struct NaClSecureService *self) { |
| 95 NaClLog(5, "NaClSecureServiceThreadCountDecr\n"); | 95 NaClLog(5, "NaClSecureServiceThreadCountDecr\n"); |
| 96 NaClXMutexLock(&self->mu); | 96 NaClXMutexLock(&self->mu); |
| 97 if (0 == self->conn_count) { | 97 if (0 == self->conn_count) { |
| 98 NaClLog(LOG_FATAL, | 98 NaClLog(LOG_FATAL, |
| 99 "NaClSecureServiceThreadCountDecr: " | 99 "NaClSecureServiceThreadCountDecr: " |
| 100 "decrementing thread count when count is zero\n"); | 100 "decrementing thread count when count is zero\n"); |
| 101 } | 101 } |
| 102 if (0 == --self->conn_count) { | 102 if (0 == --self->conn_count) { |
| 103 NaClLog(4, "NaClSecureServiceThread: all channels closed, exiting.\n"); | 103 NaClLog(4, "NaClSecureServiceThread: all channels closed, exiting.\n"); |
|
bsy
2012/10/23 17:42:35
please add a comment for why this is needed, since
halyavin
2012/10/23 18:42:42
I added a comment.
| |
| 104 NaClExit(0); | 104 NaClReportExitStatus(self->nap, 0); |
| 105 } | 105 } |
| 106 NaClXMutexUnlock(&self->mu); | 106 NaClXMutexUnlock(&self->mu); |
| 107 } | 107 } |
| 108 | 108 |
| 109 int NaClSecureServiceAcceptConnection( | 109 int NaClSecureServiceAcceptConnection( |
| 110 struct NaClSimpleService *vself, | 110 struct NaClSimpleService *vself, |
| 111 struct NaClSimpleServiceConnection **vconn) { | 111 struct NaClSimpleServiceConnection **vconn) { |
| 112 struct NaClSecureService *self = | 112 struct NaClSecureService *self = |
| 113 (struct NaClSecureService *) vself; | 113 (struct NaClSecureService *) vself; |
| 114 int status; | 114 int status; |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 330 | 330 |
| 331 struct NaClSecureReverseClientVtbl const kNaClSecureReverseClientVtbl = { | 331 struct NaClSecureReverseClientVtbl const kNaClSecureReverseClientVtbl = { |
| 332 { | 332 { |
| 333 { | 333 { |
| 334 NaClSecureReverseClientDtor, | 334 NaClSecureReverseClientDtor, |
| 335 }, | 335 }, |
| 336 }, | 336 }, |
| 337 NaClSecureReverseClientInsertHandler, | 337 NaClSecureReverseClientInsertHandler, |
| 338 NaClSecureReverseClientRemoveHandler, | 338 NaClSecureReverseClientRemoveHandler, |
| 339 }; | 339 }; |
| OLD | NEW |