From 3066f3dbf87e3b5a9ea12f7e81ded55f6d6f2bd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Thu, 15 Oct 2009 07:48:31 +0000 Subject: [PATCH] * 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 --- headers/private/kernel/lock.h | 12 +++++------- .../kernel/disk_device_manager/KDiskDevice.cpp | 3 ++- .../disk_device_manager/KDiskDeviceManager.cpp | 3 ++- src/system/kernel/messaging/MessagingService.cpp | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/headers/private/kernel/lock.h b/headers/private/kernel/lock.h index a2247a611a..23de9af291 100644 --- a/headers/private/kernel/lock.h +++ b/headers/private/kernel/lock.h @@ -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 diff --git a/src/system/kernel/disk_device_manager/KDiskDevice.cpp b/src/system/kernel/disk_device_manager/KDiskDevice.cpp index 4f1c74a066..d50a338313 100644 --- a/src/system/kernel/disk_device_manager/KDiskDevice.cpp +++ b/src/system/kernel/disk_device_manager/KDiskDevice.cpp @@ -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"; diff --git a/src/system/kernel/disk_device_manager/KDiskDeviceManager.cpp b/src/system/kernel/disk_device_manager/KDiskDeviceManager.cpp index ea4ca690b6..98d5d2d2f0 100644 --- a/src/system/kernel/disk_device_manager/KDiskDeviceManager.cpp +++ b/src/system/kernel/disk_device_manager/KDiskDeviceManager.cpp @@ -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; diff --git a/src/system/kernel/messaging/MessagingService.cpp b/src/system/kernel/messaging/MessagingService.cpp index 8f7f5d68fc..728a31eb5b 100644 --- a/src/system/kernel/messaging/MessagingService.cpp +++ b/src/system/kernel/messaging/MessagingService.cpp @@ -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"); }