source: asp3_tinet_ecnl_arm/trunk/musl-1.1.18/src/thread/vmlock.c@ 352

Last change on this file since 352 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: 284 bytes
Line 
1#include "pthread_impl.h"
2
3static volatile int vmlock[2];
4
5void __vm_wait()
6{
7 int tmp;
8 while ((tmp=vmlock[0]))
9 __wait(vmlock, vmlock+1, tmp, 1);
10}
11
12void __vm_lock()
13{
14 a_inc(vmlock);
15}
16
17void __vm_unlock()
18{
19 if (a_fetch_add(vmlock, -1)==1 && vmlock[1])
20 __wake(vmlock, -1, 1);
21}
Note: See TracBrowser for help on using the repository browser.