ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/SheepShaver/src/Unix/sysdeps.h
(Generate patch)

Comparing SheepShaver/src/Unix/sysdeps.h (file contents):
Revision 1.31 by gbeauche, 2004-05-20T17:46:49Z vs.
Revision 1.32 by gbeauche, 2004-06-02T16:11:49Z

# Line 249 | Line 249 | static inline int testandset(volatile in
249   }
250   #endif
251  
252 < #if defined(__i386__) || defined(__x86_64__)
252 > /* FIXME: SheepShaver occasionnally hangs with those locks */
253 > #if 0 && (defined(__i386__) || defined(__x86_64__))
254   #define HAVE_TEST_AND_SET 1
255   static inline int testandset(volatile int *p)
256   {
# Line 328 | Line 329 | static inline int testandset(volatile in
329  
330   #endif /* __GNUC__ */
331  
331 #if HAVE_TEST_AND_SET
332 #define HAVE_SPINLOCKS 1
332   typedef volatile int spinlock_t;
333  
334   static const spinlock_t SPIN_LOCK_UNLOCKED = 0;
335  
336 + #if HAVE_TEST_AND_SET
337 + #define HAVE_SPINLOCKS 1
338   static inline void spin_lock(spinlock_t *lock)
339   {
340          while (testandset(lock));
# Line 348 | Line 349 | static inline int spin_trylock(spinlock_
349   {
350          return !testandset(lock);
351   }
352 + #else
353 + static inline void spin_lock(spinlock_t *lock)
354 + {
355 + }
356 +
357 + static inline void spin_unlock(spinlock_t *lock)
358 + {
359 + }
360 +
361 + static inline int spin_trylock(spinlock_t *lock)
362 + {
363 +        return 1;
364 + }
365   #endif
366  
367   // Time data type for Time Manager emulation

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines