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

Side by Side Diff: src/shared/platform/nacl_sync_checked.c

Issue 6937003: modified nacl_sync.h to have NACL_WUR for all functions that return a (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: '' Created 9 years, 7 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
« no previous file with comments | « src/shared/platform/nacl_sync_checked.h ('k') | src/trusted/desc/nacl_desc_wrapper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2008 The Native Client Authors. All rights reserved. 2 * Copyright (c) 2011 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can 3 * Use of this source code is governed by a BSD-style license that can be
4 * be found in the LICENSE file. 4 * found in the LICENSE file.
5 */ 5 */
6 6
7 /* 7 /*
8 * NaCl Server Runtime mutex and condition variable abstraction layer. 8 * NaCl Server Runtime mutex and condition variable abstraction layer.
9 * The NaClX* interfaces just invoke the no-X versions of the 9 * The NaClX* interfaces just invoke the no-X versions of the
10 * synchronization routines, and aborts if there are any error 10 * synchronization routines, and aborts if there are any error
11 * returns. 11 * returns.
12 */ 12 */
13 13
14 #include "native_client/src/shared/platform/nacl_log.h" 14 #include "native_client/src/shared/platform/nacl_log.h"
15 #include "native_client/src/shared/platform/nacl_sync_checked.h" 15 #include "native_client/src/shared/platform/nacl_sync_checked.h"
16 16
17 void NaClXMutexCtor(struct NaClMutex *mp) {
18 if (!NaClMutexCtor(mp)) {
19 NaClLog(LOG_FATAL, "NaClXMutexCtor failed\n");
20 }
21 }
22
17 void NaClXMutexLock(struct NaClMutex *mp) { 23 void NaClXMutexLock(struct NaClMutex *mp) {
18 NaClSyncStatus status; 24 NaClSyncStatus status;
19 25
20 if (NACL_SYNC_OK == (status = NaClMutexLock(mp))) { 26 if (NACL_SYNC_OK == (status = NaClMutexLock(mp))) {
21 return; 27 return;
22 } 28 }
23 NaClLog(LOG_FATAL, "NaClMutexLock returned %d\n", status); 29 NaClLog(LOG_FATAL, "NaClMutexLock returned %d\n", status);
24 } 30 }
25 31
26 NaClSyncStatus NaClXMutexTryLock(struct NaClMutex *mp) { 32 NaClSyncStatus NaClXMutexTryLock(struct NaClMutex *mp) {
(...skipping 10 matching lines...) Expand all
37 43
38 void NaClXMutexUnlock(struct NaClMutex *mp) { 44 void NaClXMutexUnlock(struct NaClMutex *mp) {
39 NaClSyncStatus status; 45 NaClSyncStatus status;
40 46
41 if (NACL_SYNC_OK == (status = NaClMutexUnlock(mp))) { 47 if (NACL_SYNC_OK == (status = NaClMutexUnlock(mp))) {
42 return; 48 return;
43 } 49 }
44 NaClLog(LOG_FATAL, "NaClMutexUnlock returned %d\n", status); 50 NaClLog(LOG_FATAL, "NaClMutexUnlock returned %d\n", status);
45 } 51 }
46 52
53 void NaClXCondVarCtor(struct NaClCondVar *cvp) {
54 if (!NaClCondVarCtor(cvp)) {
55 NaClLog(LOG_FATAL, "NaClCondVarCtor failed\n");
56 }
57 }
58
47 void NaClXCondVarSignal(struct NaClCondVar *cvp) { 59 void NaClXCondVarSignal(struct NaClCondVar *cvp) {
48 NaClSyncStatus status; 60 NaClSyncStatus status;
49 61
50 if (NACL_SYNC_OK == (status = NaClCondVarSignal(cvp))) { 62 if (NACL_SYNC_OK == (status = NaClCondVarSignal(cvp))) {
51 return; 63 return;
52 } 64 }
53 NaClLog(LOG_FATAL, "NaClCondVarSignal returned %d\n", status); 65 NaClLog(LOG_FATAL, "NaClCondVarSignal returned %d\n", status);
54 } 66 }
55 67
56 void NaClXCondVarBroadcast(struct NaClCondVar *cvp) { 68 void NaClXCondVarBroadcast(struct NaClCondVar *cvp) {
(...skipping 17 matching lines...) Expand all
74 86
75 NaClSyncStatus NaClXCondVarTimedWaitAbsolute( 87 NaClSyncStatus NaClXCondVarTimedWaitAbsolute(
76 struct NaClCondVar *cvp, 88 struct NaClCondVar *cvp,
77 struct NaClMutex *mp, 89 struct NaClMutex *mp,
78 struct nacl_abi_timespec const *abstime) { 90 struct nacl_abi_timespec const *abstime) {
79 NaClSyncStatus status = NaClCondVarTimedWaitAbsolute(cvp, mp, abstime); 91 NaClSyncStatus status = NaClCondVarTimedWaitAbsolute(cvp, mp, abstime);
80 92
81 if (NACL_SYNC_OK == status || NACL_SYNC_CONDVAR_TIMEDOUT == status) { 93 if (NACL_SYNC_OK == status || NACL_SYNC_CONDVAR_TIMEDOUT == status) {
82 return status; 94 return status;
83 } 95 }
84 NaClLog(LOG_FATAL, "NaClCondVarTimedWait returned %d\n", status); 96 NaClLog(LOG_FATAL, "NaClCondVarTimedWaitAbsolute returned %d\n", status);
85 /* NOTREACHED */ 97 /* NOTREACHED */
86 return NACL_SYNC_INTERNAL_ERROR; 98 return NACL_SYNC_INTERNAL_ERROR;
87 } 99 }
88 100
89 NaClSyncStatus NaClXCondVarTimedWaitRelative( 101 NaClSyncStatus NaClXCondVarTimedWaitRelative(
90 struct NaClCondVar *cvp, 102 struct NaClCondVar *cvp,
91 struct NaClMutex *mp, 103 struct NaClMutex *mp,
92 struct nacl_abi_timespec const *reltime) { 104 struct nacl_abi_timespec const *reltime) {
93 NaClSyncStatus status = NaClCondVarTimedWaitAbsolute(cvp, mp, reltime); 105 NaClSyncStatus status = NaClCondVarTimedWaitRelative(cvp, mp, reltime);
94 106
95 if (NACL_SYNC_OK == status || NACL_SYNC_CONDVAR_TIMEDOUT == status) { 107 if (NACL_SYNC_OK == status || NACL_SYNC_CONDVAR_TIMEDOUT == status) {
96 return status; 108 return status;
97 } 109 }
98 NaClLog(LOG_FATAL, "NaClCondVarTimedWait returned %d\n", status); 110 NaClLog(LOG_FATAL, "NaClCondVarTimedWaitRelative returned %d\n", status);
99 /* NOTREACHED */ 111 /* NOTREACHED */
100 return NACL_SYNC_INTERNAL_ERROR; 112 return NACL_SYNC_INTERNAL_ERROR;
101 } 113 }
OLDNEW
« no previous file with comments | « src/shared/platform/nacl_sync_checked.h ('k') | src/trusted/desc/nacl_desc_wrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698