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

Side by Side Diff: sysdeps/nacl/futex_emulation.c

Issue 183973024: Remove __nacl_futex_fini (Closed) Base URL: http://git.chromium.org/native_client/nacl-glibc.git@master
Patch Set: Created 6 years, 9 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
« no previous file with comments | « elf/dl-fini.c ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include <futex_emulation.h> 1 #include <futex_emulation.h>
2 2
3 #include <assert.h> 3 #include <assert.h>
4 #include <errno.h> 4 #include <errno.h>
5 #include <irt_syscalls.h> 5 #include <irt_syscalls.h>
6 #include <tls.h> 6 #include <tls.h>
7 7
8 8
9 static int global_futex_emulation_mutex_desc = -1; 9 static int global_futex_emulation_mutex_desc = -1;
10 static LIST_HEAD (waiters_list); 10 static LIST_HEAD (waiters_list);
11 11
12 void __nacl_futex_init (void) 12 void __nacl_futex_init (void)
13 { 13 {
14 assert (global_futex_emulation_mutex_desc == -1); 14 assert (global_futex_emulation_mutex_desc == -1);
15 __nacl_irt_mutex_create (&global_futex_emulation_mutex_desc); 15 __nacl_irt_mutex_create (&global_futex_emulation_mutex_desc);
16 } 16 }
17 17
18 void __nacl_futex_fini (void)
19 {
20 __nacl_irt_mutex_destroy (global_futex_emulation_mutex_desc);
21 }
22
23 int __nacl_futex_wait (volatile int *addr, int val, unsigned int bitset, 18 int __nacl_futex_wait (volatile int *addr, int val, unsigned int bitset,
24 const struct timespec *timeout) 19 const struct timespec *timeout)
25 { 20 {
26 int retcode = -EINTR; 21 int retcode = -EINTR;
27 22
28 if (__nacl_irt_mutex_lock (global_futex_emulation_mutex_desc)) 23 if (__nacl_irt_mutex_lock (global_futex_emulation_mutex_desc))
29 goto ret_no_unlock; 24 goto ret_no_unlock;
30 25
31 if (*addr != val) 26 if (*addr != val)
32 { 27 {
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 __nacl_irt_mutex_unlock (global_futex_emulation_mutex_desc); 281 __nacl_irt_mutex_unlock (global_futex_emulation_mutex_desc);
287 return retcode; 282 return retcode;
288 } 283 }
289 284
290 ret_unlock: 285 ret_unlock:
291 if (!__nacl_irt_mutex_unlock (global_futex_emulation_mutex_desc)) 286 if (!__nacl_irt_mutex_unlock (global_futex_emulation_mutex_desc))
292 retcode = 0; 287 retcode = 0;
293 ret_no_unlock: 288 ret_no_unlock:
294 return retcode; 289 return retcode;
295 } 290 }
OLDNEW
« no previous file with comments | « elf/dl-fini.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698