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

Unified Diff: src/shared/platform/nacl_semaphore_test.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, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/shared/platform/nacl_log.c ('k') | src/shared/platform/nacl_sync.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/shared/platform/nacl_semaphore_test.c
===================================================================
--- src/shared/platform/nacl_semaphore_test.c (revision 5177)
+++ src/shared/platform/nacl_semaphore_test.c (working copy)
@@ -12,6 +12,7 @@
#include "native_client/src/shared/platform/nacl_semaphore.h"
#include "native_client/src/shared/platform/nacl_sync.h"
+#include "native_client/src/shared/platform/nacl_sync_checked.h"
#include "native_client/src/shared/platform/nacl_threads.h"
#include "native_client/src/shared/platform/nacl_time.h"
#include "native_client/src/shared/platform/platform_init.h"
@@ -54,10 +55,10 @@
break;
}
if (0 == sleep_count) {
- NaClMutexLock(&gMu);
+ NaClXMutexLock(&gMu);
++gNumThreadsTried;
- NaClMutexUnlock(&gMu);
- NaClCondVarSignal(&gCv);
+ NaClXCondVarSignal(&gCv);
+ NaClXMutexUnlock(&gMu);
}
PauseSpinningThread();
}
@@ -84,11 +85,11 @@
printf("OK -- thread %d\n", thread_num);
}
- NaClMutexLock(&gMu);
+ NaClXMutexLock(&gMu);
gFailure += failed;
++gNumThreadsDone;
- NaClCondVarSignal(&gCv);
- NaClMutexUnlock(&gMu);
+ NaClXCondVarSignal(&gCv);
+ NaClXMutexUnlock(&gMu);
}
int main(int ac, char **av) {
@@ -140,22 +141,22 @@
}
}
- NaClMutexLock(&gMu);
+ NaClXMutexLock(&gMu);
while (gNumThreadsTried != num_threads) {
- NaClCondVarWait(&gCv, &gMu);
+ NaClXCondVarWait(&gCv, &gMu);
}
- NaClMutexUnlock(&gMu);
+ NaClXMutexUnlock(&gMu);
for (n = 0; n < num_threads; ++n) {
NaClSemPost(&gSem); /* let a thread go */
}
- NaClMutexLock(&gMu);
+ NaClXMutexLock(&gMu);
while (gNumThreadsDone != num_threads) {
- NaClCondVarWait(&gCv, &gMu);
+ NaClXCondVarWait(&gCv, &gMu);
}
exit_status = gFailure;
- NaClMutexUnlock(&gMu);
+ NaClXMutexUnlock(&gMu);
if (0 == exit_status) {
printf("SUCCESS\n");
« no previous file with comments | « src/shared/platform/nacl_log.c ('k') | src/shared/platform/nacl_sync.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698