dec.h (4f9d94bf6491250b649f5bc931b6d93e68373005) | dec.h (271ce40239ec643af1264c36b73ea1563f4263ba) |
---|---|
1/* 2 * Copyright 2010-2015 Samy Al Bahra. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 97 unchanged lines hidden (view full) --- 106 ck_backoff_t backoff = CK_BACKOFF_INITIALIZER; 107 bool r; 108 109 for (;;) { 110 ck_pr_dec_uint_zero(&lock->value, &r); 111 if (r == true) 112 break; 113 | 1/* 2 * Copyright 2010-2015 Samy Al Bahra. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 97 unchanged lines hidden (view full) --- 106 ck_backoff_t backoff = CK_BACKOFF_INITIALIZER; 107 bool r; 108 109 for (;;) { 110 ck_pr_dec_uint_zero(&lock->value, &r); 111 if (r == true) 112 break; 113 |
114 ck_backoff_eb(&backoff); | 114 while (ck_pr_load_uint(&lock->value) != 1) 115 ck_backoff_eb(&backoff); |
115 } 116 117 ck_pr_fence_lock(); 118 return; 119} 120 121CK_CC_INLINE static void 122ck_spinlock_dec_unlock(struct ck_spinlock_dec *lock) --- 21 unchanged lines hidden --- | 116 } 117 118 ck_pr_fence_lock(); 119 return; 120} 121 122CK_CC_INLINE static void 123ck_spinlock_dec_unlock(struct ck_spinlock_dec *lock) --- 21 unchanged lines hidden --- |