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

Side by Side Diff: native_client_sdk/src/libraries/nacl_io/mount_html5fs.cc

Issue 18644009: [NaCl SDK] Upate atomic ops in nacl_io (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add declartions for newval and oldval Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 /* Copyright (c) 2012 The Chromium 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 5
6 #include "nacl_io/mount_html5fs.h" 6 #include "nacl_io/mount_html5fs.h"
7 7
8 #include <errno.h> 8 #include <errno.h>
9 #include <fcntl.h> 9 #include <fcntl.h>
10 #include <ppapi/c/pp_completion_callback.h> 10 #include <ppapi/c/pp_completion_callback.h>
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 return 0; 162 return 0;
163 } 163 }
164 } 164 }
165 165
166 void MountHtml5Fs::Destroy() { 166 void MountHtml5Fs::Destroy() {
167 ppapi_->ReleaseResource(filesystem_resource_); 167 ppapi_->ReleaseResource(filesystem_resource_);
168 pthread_cond_destroy(&filesystem_open_cond_); 168 pthread_cond_destroy(&filesystem_open_cond_);
169 } 169 }
170 170
171 Error MountHtml5Fs::BlockUntilFilesystemOpen() { 171 Error MountHtml5Fs::BlockUntilFilesystemOpen() {
172 AutoLock lock(&lock_); 172 AUTO_LOCK(filesysem_open_lock_);
173 while (!filesystem_open_has_result_) { 173 while (!filesystem_open_has_result_) {
174 pthread_cond_wait(&filesystem_open_cond_, &lock_); 174 pthread_cond_wait(&filesystem_open_cond_, filesysem_open_lock_.mutex());
175 } 175 }
176 return filesystem_open_error_; 176 return filesystem_open_error_;
177 } 177 }
178 178
179 // static 179 // static
180 void MountHtml5Fs::FilesystemOpenCallbackThunk(void* user_data, 180 void MountHtml5Fs::FilesystemOpenCallbackThunk(void* user_data,
181 int32_t result) { 181 int32_t result) {
182 MountHtml5Fs* self = static_cast<MountHtml5Fs*>(user_data); 182 MountHtml5Fs* self = static_cast<MountHtml5Fs*>(user_data);
183 self->FilesystemOpenCallback(result); 183 self->FilesystemOpenCallback(result);
184 } 184 }
185 185
186 void MountHtml5Fs::FilesystemOpenCallback(int32_t result) { 186 void MountHtml5Fs::FilesystemOpenCallback(int32_t result) {
187 AutoLock lock(&lock_); 187 AUTO_LOCK(filesysem_open_lock_);
188 filesystem_open_has_result_ = true; 188 filesystem_open_has_result_ = true;
189 filesystem_open_error_ = PPErrorToErrno(result); 189 filesystem_open_error_ = PPErrorToErrno(result);
190 pthread_cond_signal(&filesystem_open_cond_); 190 pthread_cond_signal(&filesystem_open_cond_);
191 } 191 }
192 192
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698