InterruptsSpinLocking:

* Removed unused inner struct State.
* Added work-around for the extremely annoying "fState my be used
  uninitialized" warning gcc 4 produces. I'm not aware of any solution that
  doesn't generate unnecessary code. :-/


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31193 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2009-06-23 01:32:46 +00:00
parent 6a6974b63e
commit 91393e7810

View File

@ -132,15 +132,15 @@ typedef AutoLocker<spinlock, SpinLocking> SpinLocker;
// InterruptsSpinLocking // InterruptsSpinLocking
class InterruptsSpinLocking { class InterruptsSpinLocking {
public: public:
struct State { // NOTE: work-around for annoying GCC 4 "fState may be used uninitialized"
State(spinlock* lock) // warning.
: lock(lock) #if __GNUC__ == 4
{ InterruptsSpinLocking()
} :
fState(0)
int state; {
spinlock* lock; }
}; #endif
inline bool Lock(spinlock* lockable) inline bool Lock(spinlock* lockable)
{ {