| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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"); |
| 104 NaClExit(0); | 104 /* |
| 105 * Set exit code for application. This wakes up main thread and |
| 106 * application will terminate gracefully there. This is needed to allow |
| 107 * debug stub to send exit status to debugger. This way we can detect |
| 108 * normal NaCl module exit in tests. |
| 109 */ |
| 110 NaClReportExitStatus(self->nap, 0); |
| 105 } | 111 } |
| 106 NaClXMutexUnlock(&self->mu); | 112 NaClXMutexUnlock(&self->mu); |
| 107 } | 113 } |
| 108 | 114 |
| 109 int NaClSecureServiceAcceptConnection( | 115 int NaClSecureServiceAcceptConnection( |
| 110 struct NaClSimpleService *vself, | 116 struct NaClSimpleService *vself, |
| 111 struct NaClSimpleServiceConnection **vconn) { | 117 struct NaClSimpleServiceConnection **vconn) { |
| 112 struct NaClSecureService *self = | 118 struct NaClSecureService *self = |
| 113 (struct NaClSecureService *) vself; | 119 (struct NaClSecureService *) vself; |
| 114 int status; | 120 int status; |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 | 336 |
| 331 struct NaClSecureReverseClientVtbl const kNaClSecureReverseClientVtbl = { | 337 struct NaClSecureReverseClientVtbl const kNaClSecureReverseClientVtbl = { |
| 332 { | 338 { |
| 333 { | 339 { |
| 334 NaClSecureReverseClientDtor, | 340 NaClSecureReverseClientDtor, |
| 335 }, | 341 }, |
| 336 }, | 342 }, |
| 337 NaClSecureReverseClientInsertHandler, | 343 NaClSecureReverseClientInsertHandler, |
| 338 NaClSecureReverseClientRemoveHandler, | 344 NaClSecureReverseClientRemoveHandler, |
| 339 }; | 345 }; |
| OLD | NEW |