~mmach/netext73/wasi-libc

« back to all changes in this revision

Viewing changes to libc-top-half/musl/src/thread/pthread_mutex_trylock.c

  • Committer: mmach
  • Date: 2023-09-12 15:53:36 UTC
  • Revision ID: netbit73@gmail.com-20230912155336-s1r5z5xnszz99zzo
0.0~git20230113.4362b18

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
        if (type & 128) {
28
28
                if (!self->robust_list.off) {
29
29
                        self->robust_list.off = (char*)&m->_m_lock-(char *)&m->_m_next;
 
30
#ifdef __wasilibc_unmodified_upstream
30
31
                        __syscall(SYS_set_robust_list, &self->robust_list, 3*sizeof(long));
 
32
#endif
31
33
                }
32
34
                if (m->_m_waiters) tid |= 0x80000000;
33
35
                self->robust_list.pending = &m->_m_next;
43
45
success:
44
46
        if ((type&8) && m->_m_waiters) {
45
47
                int priv = (type & 128) ^ 128;
 
48
#ifdef __wasilibc_unmodified_upstream
46
49
                __syscall(SYS_futex, &m->_m_lock, FUTEX_UNLOCK_PI|priv);
 
50
#endif
47
51
                self->robust_list.pending = 0;
48
52
                return (type&4) ? ENOTRECOVERABLE : EBUSY;
49
53
        }