Changeset 23578
- Timestamp:
- 2008-03-27 15:48:06 (7 months ago)
- Location:
- trunk/launchd/src
- Files:
-
- 2 modified
-
libvproc.c (modified) (5 diffs)
-
libvproc_private.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/launchd/src/libvproc.c
r23577 r23578 93 93 _basic_vproc_transaction_begin(void) 94 94 { 95 int64_tnewval;95 typeof(vproc_shmem->vp_shmem_transaction_cnt) newval; 96 96 97 97 if (unlikely(vproc_shmem == NULL)) { … … 115 115 } 116 116 117 size_t 118 _basic_vproc_transaction_count(void) 119 { 120 return likely(vproc_shmem) ? vproc_shmem->vp_shmem_transaction_cnt : INT32_MAX; 121 } 122 123 void 124 _basic_vproc_transaction_try_exit(int status) 125 { 126 typeof(vproc_shmem->vp_shmem_transaction_cnt) newval; 127 128 if (unlikely(vproc_shmem == NULL)) { 129 return; 130 } 131 132 vproc_shmem->vp_shmem_flags |= VPROC_SHMEM_EXITING; 133 134 newval = __sync_sub_and_fetch(&vproc_shmem->vp_shmem_transaction_cnt, 1); 135 136 if (newval < 0) { 137 _exit(status); 138 } 139 } 140 117 141 void 118 142 vproc_transaction_end(vproc_t vp __attribute__((unused)), vproc_transaction_t vpt) … … 129 153 _basic_vproc_transaction_end(void) 130 154 { 131 int32_t newval = __sync_sub_and_fetch(&vproc_shmem->vp_shmem_transaction_cnt, 1); 155 typeof(vproc_shmem->vp_shmem_transaction_cnt) newval; 156 157 newval = __sync_sub_and_fetch(&vproc_shmem->vp_shmem_transaction_cnt, 1); 132 158 133 159 if (unlikely(newval < 0)) { … … 146 172 { 147 173 vproc_standby_t vpsb = (vproc_standby_t)vproc_shmem_init; /* we need a "random" variable that is testable */ 148 int64_tnewval;174 typeof(vproc_shmem->vp_shmem_standby_cnt) newval; 149 175 150 176 if (unlikely(vproc_shmem == NULL)) { … … 168 194 vproc_standby_end(vproc_t vp __attribute__((unused)), vproc_standby_t vpt) 169 195 { 170 int32_tnewval;196 typeof(vproc_shmem->vp_shmem_standby_cnt) newval; 171 197 172 198 if (unlikely(vpt != (vproc_standby_t)vproc_shmem_init)) { -
trunk/launchd/src/libvproc_private.h
r23574 r23578 79 79 void _basic_vproc_transaction_begin(void); 80 80 void _basic_vproc_transaction_end(void); 81 size_t _basic_vproc_transaction_count(void); 82 void _basic_vproc_transaction_try_exit(int status); 83 81 84 82 85 #pragma GCC visibility pop

