Lines Matching refs:ptrlock
30 A ptrlock has four states:
32 1 Owned by me, I get to write a pointer to ptrlock.
33 2 Some thread is waiting on the ptrlock.
35 It is not valid to gain the ptrlock and then write a NULL to it. */
42 static inline void gomp_ptrlock_init (gomp_ptrlock_t *ptrlock, void *ptr)
44 *ptrlock = ptr;
47 extern void *gomp_ptrlock_get_slow (gomp_ptrlock_t *ptrlock);
48 static inline void *gomp_ptrlock_get (gomp_ptrlock_t *ptrlock)
52 uintptr_t v = (uintptr_t) __atomic_load_n (ptrlock, MEMMODEL_ACQUIRE);
57 if (__atomic_compare_exchange_n (ptrlock, &oldval, 1, false,
61 return gomp_ptrlock_get_slow (ptrlock);
64 extern void gomp_ptrlock_set_slow (gomp_ptrlock_t *ptrlock);
65 static inline void gomp_ptrlock_set (gomp_ptrlock_t *ptrlock, void *ptr)
67 void *wait = __atomic_exchange_n (ptrlock, ptr, MEMMODEL_RELEASE);
69 gomp_ptrlock_set_slow (ptrlock);
72 static inline void gomp_ptrlock_destroy (gomp_ptrlock_t *ptrlock)