* Reverted r33547, this closes bug #4782 - this is obviously a regression in

GCC4.
* Adapted code accordingly.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33592 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2009-10-15 07:48:31 +00:00
parent 1851e9f3e0
commit 3066f3dbf8
4 changed files with 10 additions and 10 deletions

View File

@ -78,16 +78,14 @@ typedef struct rw_lock {
// static initializers
#if KDEBUG
# define MUTEX_INITIALIZER(name) (mutex){ name, NULL, -1, 0 }
# define RECURSIVE_LOCK_INITIALIZER(name) \
(recursive_lock){ MUTEX_INITIALIZER(name), 0 }
# define MUTEX_INITIALIZER(name) { name, NULL, -1, 0 }
# define RECURSIVE_LOCK_INITIALIZER(name) { MUTEX_INITIALIZER(name), 0 }
#else
# define MUTEX_INITIALIZER(name) (mutex){ name, NULL, 0, 0 }
# define RECURSIVE_LOCK_INITIALIZER(name) \
(recursive_lock){ MUTEX_INITIALIZER(name), -1, 0 }
# define MUTEX_INITIALIZER(name) { name, NULL, 0, 0 }
# define RECURSIVE_LOCK_INITIALIZER(name) { MUTEX_INITIALIZER(name), -1, 0 }
#endif
#define RW_LOCK_INITIALIZER(name) (rw_lock){ name, NULL, -1, 0, 0, 0 }
#define RW_LOCK_INITIALIZER(name) { name, NULL, -1, 0, 0, 0 }
#if KDEBUG

View File

@ -28,10 +28,11 @@ KDiskDevice::KDiskDevice(partition_id id)
:
KPartition(id),
fDeviceData(),
fLocker(RW_LOCK_INITIALIZER("disk device")),
fFD(-1),
fMediaStatus(B_ERROR)
{
rw_lock_init(&fLocker, "disk device");
Unset();
fDevice = this;
fPublishedName = (char*)"raw";

View File

@ -239,7 +239,6 @@ public:
KDiskDeviceManager::KDiskDeviceManager()
:
fLock(RECURSIVE_LOCK_INITIALIZER("disk device manager")),
fDevices(new(nothrow) DeviceMap),
fPartitions(new(nothrow) PartitionMap),
fDiskSystems(new(nothrow) DiskSystemMap),
@ -250,6 +249,8 @@ KDiskDeviceManager::KDiskDeviceManager()
fDeviceWatcher(new(nothrow) DeviceWatcher()),
fNotifications(new(nothrow) DiskNotifications)
{
recursive_lock_init(&fLock, "disk device manager");
if (InitCheck() != B_OK)
return;

View File

@ -260,10 +260,10 @@ MessagingArea::_CheckCommand(int32 offset, int32 &size)
MessagingService::MessagingService()
:
fLock(RECURSIVE_LOCK_INITIALIZER("messaging service")),
fFirstArea(NULL),
fLastArea(NULL)
{
recursive_lock_init(&fLock, "messaging service");
}