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
1 changed files with 9 additions and 9 deletions

View File

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