Changeset 7dd56f1 in mainline for src/synch/spinlock.c
- Timestamp:
- 2005-08-07T23:14:14Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 511b45f
- Parents:
- 60f760a0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/synch/spinlock.c
r60f760a0 r7dd56f1 30 30 31 31 #include <arch/atomic.h> 32 #include <arch/barrier.h> 32 33 #include <synch/spinlock.h> 33 34 … … 51 52 } 52 53 } 54 CS_ENTER_BARRIER(); 53 55 54 56 } … … 61 63 */ 62 64 spinlock_arch(&sl->val); 65 CS_ENTER_BARRIER(); 63 66 } 64 67 #endif … … 66 69 int spinlock_trylock(spinlock_t *sl) 67 70 { 68 return !test_and_set(&sl->val); 71 int rc; 72 73 rc = !test_and_set(&sl->val); 74 CS_ENTER_BARRIER(); 75 76 return rc; 69 77 } 70 78 71 79 void spinlock_unlock(spinlock_t *sl) 72 80 { 81 CS_LEAVE_BARRIER(); 73 82 sl->val = 0; 74 83 }
Note:
See TracChangeset
for help on using the changeset viewer.