[haiku-commits] r33592 - in haiku/trunk: headers/private/kernel src/system/kernel/disk_device_manager src/system/kernel/messaging

  • From: axeld@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 15 Oct 2009 09:48:31 +0200 (CEST)

Author: axeld
Date: 2009-10-15 09:48:31 +0200 (Thu, 15 Oct 2009)
New Revision: 33592
Changeset: http://dev.haiku-os.org/changeset/33592/haiku

Modified:
   haiku/trunk/headers/private/kernel/lock.h
   haiku/trunk/src/system/kernel/disk_device_manager/KDiskDevice.cpp
   haiku/trunk/src/system/kernel/disk_device_manager/KDiskDeviceManager.cpp
   haiku/trunk/src/system/kernel/messaging/MessagingService.cpp
Log:
* Reverted r33547, this closes bug #4782 - this is obviously a regression in
  GCC4.
* Adapted code accordingly.


Modified: haiku/trunk/headers/private/kernel/lock.h
===================================================================
--- haiku/trunk/headers/private/kernel/lock.h   2009-10-15 04:40:33 UTC (rev 
33591)
+++ haiku/trunk/headers/private/kernel/lock.h   2009-10-15 07:48:31 UTC (rev 
33592)
@@ -78,16 +78,14 @@
 
 // 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

Modified: haiku/trunk/src/system/kernel/disk_device_manager/KDiskDevice.cpp
===================================================================
--- haiku/trunk/src/system/kernel/disk_device_manager/KDiskDevice.cpp   
2009-10-15 04:40:33 UTC (rev 33591)
+++ haiku/trunk/src/system/kernel/disk_device_manager/KDiskDevice.cpp   
2009-10-15 07:48:31 UTC (rev 33592)
@@ -28,10 +28,11 @@
        :
        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";

Modified: 
haiku/trunk/src/system/kernel/disk_device_manager/KDiskDeviceManager.cpp
===================================================================
--- haiku/trunk/src/system/kernel/disk_device_manager/KDiskDeviceManager.cpp    
2009-10-15 04:40:33 UTC (rev 33591)
+++ haiku/trunk/src/system/kernel/disk_device_manager/KDiskDeviceManager.cpp    
2009-10-15 07:48:31 UTC (rev 33592)
@@ -239,7 +239,6 @@
 
 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 @@
        fDeviceWatcher(new(nothrow) DeviceWatcher()),
        fNotifications(new(nothrow) DiskNotifications)
 {
+       recursive_lock_init(&fLock, "disk device manager");
+
        if (InitCheck() != B_OK)
                return;
 

Modified: haiku/trunk/src/system/kernel/messaging/MessagingService.cpp
===================================================================
--- haiku/trunk/src/system/kernel/messaging/MessagingService.cpp        
2009-10-15 04:40:33 UTC (rev 33591)
+++ haiku/trunk/src/system/kernel/messaging/MessagingService.cpp        
2009-10-15 07:48:31 UTC (rev 33592)
@@ -260,10 +260,10 @@
 
 MessagingService::MessagingService()
        :
-       fLock(RECURSIVE_LOCK_INITIALIZER("messaging service")),
        fFirstArea(NULL),
        fLastArea(NULL)
 {
+       recursive_lock_init(&fLock, "messaging service");
 }
 
 


Other related posts:

  • » [haiku-commits] r33592 - in haiku/trunk: headers/private/kernel src/system/kernel/disk_device_manager src/system/kernel/messaging - axeld