1
Description: use gcc intrinsics rather than assembler to implement tas
2
Author: Alexander Sack <asac@ubuntu.com>
3
Bug-Ubuntu: https://launchpad.net/bugs/497331
5
--- postgresql-8.4-8.4.2/src/include/storage/s_lock.h 2010-01-04 14:21:40.789729336 +0100
6
+++ postgresql-8.4-8.4.2.new/src/include/storage/s_lock.h 2010-01-04 14:23:46.918690895 +0100
9
tas(volatile slock_t *lock)
11
- register slock_t _res = 1;
13
- __asm__ __volatile__(
14
- " swpb %0, %0, [%2] \n"
15
-: "+r"(_res), "+m"(*lock)
19
+ return __sync_lock_test_and_set (lock, 1);