source: asp3_tinet_ecnl_arm/trunk/musl-1.1.18/src/thread/pthread_rwlock_tryrdlock.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: 293 bytes
Line 
1#include "pthread_impl.h"
2
3int pthread_rwlock_tryrdlock(pthread_rwlock_t *rw)
4{
5 int val, cnt;
6 do {
7 val = rw->_rw_lock;
8 cnt = val & 0x7fffffff;
9 if (cnt == 0x7fffffff) return EBUSY;
10 if (cnt == 0x7ffffffe) return EAGAIN;
11 } while (a_cas(&rw->_rw_lock, val, val+1) != val);
12 return 0;
13}
Note: See TracBrowser for help on using the repository browser.