| OLD | NEW |
| 1 // Copyright (c) 2010 The Native Client Authors. All rights reserved. | 1 // Copyright (c) 2010 The Native Client Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING | 5 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING |
| 6 // | 6 // |
| 7 // This is an early draft of background thread support. | 7 // This is an early draft of background thread support. |
| 8 // Until it is complete, we assume that all functions proxy functions | 8 // Until it is complete, we assume that all functions proxy functions |
| 9 // (but CallOnMainThread) are called on the main thread. | 9 // (but CallOnMainThread) are called on the main thread. |
| 10 // | 10 // |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 NaClSrpcClosure* done, | 100 NaClSrpcClosure* done, |
| 101 int32_t callback_id, | 101 int32_t callback_id, |
| 102 int32_t result) { | 102 int32_t result) { |
| 103 NACL_UNTESTED(); | 103 NACL_UNTESTED(); |
| 104 NaClSrpcClosureRunner runner(done); | 104 NaClSrpcClosureRunner runner(done); |
| 105 rpc->result = NACL_SRPC_RESULT_APP_ERROR; | 105 rpc->result = NACL_SRPC_RESULT_APP_ERROR; |
| 106 PP_CompletionCallback callback = PP_BlockUntilComplete(); | 106 PP_CompletionCallback callback = PP_BlockUntilComplete(); |
| 107 { | 107 { |
| 108 CallbackTableMutexLock ml(&upcall_mutex); | 108 CallbackTableMutexLock ml(&upcall_mutex); |
| 109 if (callback_table != NULL) { | 109 if (callback_table != NULL) { |
| 110 callback = callback_table->RemoveCallback(callback_id); | 110 char* dummy_buffer; |
| 111 callback = callback_table->RemoveCallback(callback_id, &dummy_buffer); |
| 111 } | 112 } |
| 112 } | 113 } |
| 113 if (callback.func == NULL) | 114 if (callback.func == NULL) |
| 114 return; | 115 return; |
| 115 PP_RunCompletionCallback(&callback, result); | 116 PP_RunCompletionCallback(&callback, result); |
| 116 rpc->result = NACL_SRPC_RESULT_OK; | 117 rpc->result = NACL_SRPC_RESULT_OK; |
| 117 } | 118 } |
| OLD | NEW |