Last change
on this file since 373 was 352, checked in by coas-nagasima, 6 years ago |
arm向けASP3版ECNLを追加
|
-
Property svn:eol-style
set to
native
-
Property svn:mime-type
set to
text/x-csrc;charset=UTF-8
|
File size:
449 bytes
|
Line | |
---|
1 | #include "pthread_impl.h"
|
---|
2 |
|
---|
3 | void __wait(volatile int *addr, volatile int *waiters, int val, int priv)
|
---|
4 | {
|
---|
5 | int spins=100;
|
---|
6 | if (priv) priv = FUTEX_PRIVATE;
|
---|
7 | while (spins-- && (!waiters || !*waiters)) {
|
---|
8 | if (*addr==val) a_spin();
|
---|
9 | else return;
|
---|
10 | }
|
---|
11 | if (waiters) a_inc(waiters);
|
---|
12 | while (*addr==val) {
|
---|
13 | __syscall(SYS_futex, addr, FUTEX_WAIT|priv, val, 0) != -ENOSYS
|
---|
14 | || __syscall(SYS_futex, addr, FUTEX_WAIT, val, 0);
|
---|
15 | }
|
---|
16 | if (waiters) a_dec(waiters);
|
---|
17 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.