diff --git a/src/darwin/Framework/CHIP/MTRAsyncCallbackWorkQueue.mm b/src/darwin/Framework/CHIP/MTRAsyncCallbackWorkQueue.mm
index 00b6d33..1e44b4a 100644
--- a/src/darwin/Framework/CHIP/MTRAsyncCallbackWorkQueue.mm
+++ b/src/darwin/Framework/CHIP/MTRAsyncCallbackWorkQueue.mm
@@ -23,6 +23,8 @@
 #import <os/lock.h>
 
 #import "MTRLogging_Internal.h"
+#import "MTRUnfairLock.h"
+
 #import <Matter/MTRAsyncCallbackWorkQueue.h>
 
 #pragma mark - Class extensions
@@ -72,14 +74,10 @@
 
 - (NSString *)description
 {
-    os_unfair_lock_lock(&_lock);
+    std::lock_guard lock(_lock);
 
-    auto * desc = [NSString
+    return [NSString
         stringWithFormat:@"MTRAsyncCallbackWorkQueue context: %@ items count: %lu", self.context, (unsigned long) self.items.count];
-
-    os_unfair_lock_unlock(&_lock);
-
-    return desc;
 }
 
 - (void)enqueueWorkItem:(MTRAsyncCallbackQueueWorkItem *)item
@@ -91,12 +89,11 @@
 
     [item markEnqueued];
 
-    os_unfair_lock_lock(&_lock);
+    std::lock_guard lock(_lock);
     item.workQueue = self;
     [self.items addObject:item];
 
     [self _callNextReadyWorkItem];
-    os_unfair_lock_unlock(&_lock);
 }
 
 - (void)invalidate
@@ -115,11 +112,10 @@
 // called after executing a work item
 - (void)_postProcessWorkItem:(MTRAsyncCallbackQueueWorkItem *)workItem retry:(BOOL)retry
 {
-    os_unfair_lock_lock(&_lock);
+    std::lock_guard lock(_lock);
     // sanity check if running
     if (!self.runningWorkItemCount) {
         // something is wrong with state - nothing is currently running
-        os_unfair_lock_unlock(&_lock);
         MTR_LOG_ERROR("MTRAsyncCallbackWorkQueue endWork: no work is running on work queue");
         return;
     }
@@ -129,7 +125,6 @@
     MTRAsyncCallbackQueueWorkItem * firstWorkItem = self.items.firstObject;
     if (firstWorkItem != workItem) {
         // something is wrong with this work item - should not be currently running
-        os_unfair_lock_unlock(&_lock);
         MTR_LOG_ERROR("MTRAsyncCallbackWorkQueue endWork: work item is not first on work queue");
         return;
     }
@@ -142,7 +137,6 @@
     // when "concurrency width" is implemented this will be decremented instead
     self.runningWorkItemCount = 0;
     [self _callNextReadyWorkItem];
-    os_unfair_lock_unlock(&_lock);
 }
 
 - (void)endWork:(MTRAsyncCallbackQueueWorkItem *)workItem
@@ -203,34 +197,30 @@
 
 - (void)invalidate
 {
-    os_unfair_lock_lock(&_lock);
+    std::lock_guard lock(_lock);
     [self _invalidate];
-    os_unfair_lock_unlock(&_lock);
 }
 
 - (void)markEnqueued
 {
-    os_unfair_lock_lock(&_lock);
+    std::lock_guard lock(_lock);
     _enqueued = YES;
-    os_unfair_lock_unlock(&_lock);
 }
 
 - (void)setReadyHandler:(MTRAsyncCallbackReadyHandler)readyHandler
 {
-    os_unfair_lock_lock(&_lock);
+    std::lock_guard lock(_lock);
     if (!_enqueued) {
         _readyHandler = readyHandler;
     }
-    os_unfair_lock_unlock(&_lock);
 }
 
 - (void)setCancelHandler:(dispatch_block_t)cancelHandler
 {
-    os_unfair_lock_lock(&_lock);
+    std::lock_guard lock(_lock);
     if (!_enqueued) {
         _cancelHandler = cancelHandler;
     }
-    os_unfair_lock_unlock(&_lock);
 }
 
 - (void)endWork
diff --git a/src/darwin/Framework/CHIP/MTRAsyncWorkQueue.mm b/src/darwin/Framework/CHIP/MTRAsyncWorkQueue.mm
index ff7242c..be83956 100644
--- a/src/darwin/Framework/CHIP/MTRAsyncWorkQueue.mm
+++ b/src/darwin/Framework/CHIP/MTRAsyncWorkQueue.mm
@@ -18,6 +18,7 @@
 #import "MTRAsyncWorkQueue.h"
 #import "MTRDefines_Internal.h"
 #import "MTRLogging_Internal.h"
+#import "MTRUnfairLock.h"
 
 #import <atomic>
 #import <os/lock.h>
@@ -273,13 +274,12 @@
 - (void)invalidate
 {
     ContextSnapshot context(_context); // outside of lock
-    os_unfair_lock_lock(&_lock);
+    std::lock_guard lock(_lock);
     MTR_LOG_INFO("MTRAsyncWorkQueue<%@> invalidate %tu items", context.description, _items.count);
     for (MTRAsyncWorkItem * item in _items) {
         [item cancel];
     }
     [_items removeAllObjects];
-    os_unfair_lock_unlock(&_lock);
 }
 
 - (void)_postProcessWorkItem:(MTRAsyncWorkItem *)workItem
@@ -376,8 +376,7 @@
 
 - (BOOL)hasDuplicateForTypeID:(NSUInteger)opaqueDuplicateTypeID workItemData:(id)opaqueWorkItemData
 {
-    BOOL hasDuplicate = NO;
-    os_unfair_lock_lock(&_lock);
+    std::lock_guard lock(_lock);
     // Start from the last item
     for (MTRAsyncWorkItem * item in [_items reverseObjectEnumerator]) {
         auto duplicateCheckHandler = item.duplicateCheckHandler;
@@ -386,13 +385,12 @@
             BOOL isDuplicate = NO;
             duplicateCheckHandler(opaqueWorkItemData, &isDuplicate, &stop);
             if (stop) {
-                hasDuplicate = isDuplicate;
-                break;
+                return isDuplicate;
             }
         }
     }
-    os_unfair_lock_unlock(&_lock);
-    return hasDuplicate;
+
+    return NO;
 }
 
 @end
diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm
index 98387bf..a63902f 100644
--- a/src/darwin/Framework/CHIP/MTRDevice.mm
+++ b/src/darwin/Framework/CHIP/MTRDevice.mm
@@ -352,22 +352,19 @@
 
 - (void)_performScheduledTimeUpdate
 {
-    os_unfair_lock_lock(&self->_timeSyncLock);
+    std::lock_guard lock(_timeSyncLock);
     // Device needs to still be reachable
     if (self.state != MTRDeviceStateReachable) {
         MTR_LOG_DEBUG("%@ Device is not reachable, canceling Device Time Updates.", self);
-        os_unfair_lock_unlock(&self->_timeSyncLock);
         return;
     }
     // Device must not be invalidated
     if (!self.timeUpdateScheduled) {
         MTR_LOG_DEBUG("%@ Device Time Update is no longer scheduled, MTRDevice may have been invalidated.", self);
-        os_unfair_lock_unlock(&self->_timeSyncLock);
         return;
     }
     self.timeUpdateScheduled = NO;
     [self _updateDeviceTimeAndScheduleNextUpdate];
-    os_unfair_lock_unlock(&self->_timeSyncLock);
 }
 
 - (NSArray<NSNumber *> *)_endpointsWithTimeSyncClusterServer
@@ -504,7 +501,7 @@
     }
 #endif
 
-    os_unfair_lock_lock(&self->_lock);
+    std::lock_guard lock(_lock);
 
     _weakDelegate = [MTRWeakReference weakReferenceWithObject:delegate];
     _delegateQueue = queue;
@@ -517,8 +514,6 @@
     if (setUpSubscription) {
         [self _setupSubscription];
     }
-
-    os_unfair_lock_unlock(&self->_lock);
 }
 
 - (void)invalidate
@@ -579,11 +574,9 @@
 // Return YES if there's a valid delegate AND subscription is expected to report value
 - (BOOL)_subscriptionAbleToReport
 {
-    os_unfair_lock_lock(&self->_lock);
+    std::lock_guard lock(_lock);
     id<MTRDeviceDelegate> delegate = _weakDelegate.strongObject;
-    auto state = _state;
-    os_unfair_lock_unlock(&self->_lock);
-    return (delegate != nil) && (state == MTRDeviceStateReachable);
+    return (delegate != nil) && (_state == MTRDeviceStateReachable);
 }
 
 - (BOOL)_callDelegateWithBlock:(void (^)(id<MTRDeviceDelegate>))block
@@ -667,41 +660,35 @@
 
 - (void)_handleSubscriptionError:(NSError *)error
 {
-    os_unfair_lock_lock(&self->_lock);
+    std::lock_guard lock(_lock);
 
     _internalDeviceState = MTRInternalDeviceStateUnsubscribed;
     _unreportedEvents = nil;
 
     [self _changeState:MTRDeviceStateUnreachable];
-
-    os_unfair_lock_unlock(&self->_lock);
 }
 
 - (void)_handleResubscriptionNeeded
 {
-    os_unfair_lock_lock(&self->_lock);
+    std::lock_guard lock(_lock);
 
     [self _changeState:MTRDeviceStateUnknown];
-
-    os_unfair_lock_unlock(&self->_lock);
 }
 
 - (void)_handleSubscriptionReset
 {
-    os_unfair_lock_lock(&self->_lock);
+    std::lock_guard lock(_lock);
     // if there is no delegate then also do not retry
     id<MTRDeviceDelegate> delegate = _weakDelegate.strongObject;
     if (!delegate) {
         // NOTE: Do not log anythig here: we have been invalidated, and the
         // Matter stack might already be torn down.
-        os_unfair_lock_unlock(&self->_lock);
         return;
     }
 
     // don't schedule multiple retries
     if (self.reattemptingSubscription) {
         MTR_LOG_DEFAULT("%@ already reattempting subscription", self);
-        os_unfair_lock_unlock(&self->_lock);
         return;
     }
 
@@ -722,8 +709,6 @@
         [self _reattemptSubscriptionNowIfNeeded];
         os_unfair_lock_unlock(&self->_lock);
     });
-
-    os_unfair_lock_unlock(&self->_lock);
 }
 
 - (void)_reattemptSubscriptionNowIfNeeded
@@ -740,7 +725,7 @@
 
 - (void)_handleUnsolicitedMessageFromPublisher
 {
-    os_unfair_lock_lock(&self->_lock);
+    std::lock_guard lock(_lock);
 
     [self _changeState:MTRDeviceStateReachable];
 
@@ -759,8 +744,6 @@
     // ReadClient how did we get this notification and if we _do_ have an active
     // ReadClient, this call or _setupSubscription would be no-ops.
     [self _reattemptSubscriptionNowIfNeeded];
-
-    os_unfair_lock_unlock(&self->_lock);
 }
 
 - (void)_markDeviceAsUnreachableIfNotSusbcribed
@@ -776,7 +759,8 @@
 
 - (void)_handleReportBegin
 {
-    os_unfair_lock_lock(&self->_lock);
+    std::lock_guard lock(_lock);
+
     _receivingReport = YES;
     if (_state != MTRDeviceStateReachable) {
         _receivingPrimingReport = YES;
@@ -784,12 +768,11 @@
     } else {
         _receivingPrimingReport = NO;
     }
-    os_unfair_lock_unlock(&self->_lock);
 }
 
 - (void)_handleReportEnd
 {
-    os_unfair_lock_lock(&self->_lock);
+    std::lock_guard lock(_lock);
     _receivingReport = NO;
     _receivingPrimingReport = NO;
     _estimatedStartTimeFromGeneralDiagnosticsUpTime = nil;
@@ -805,7 +788,6 @@
         });
     }
 #endif
-    os_unfair_lock_unlock(&self->_lock);
 }
 
 // assume lock is held
@@ -824,12 +806,10 @@
 
 - (void)_handleAttributeReport:(NSArray<NSDictionary<NSString *, id> *> *)attributeReport
 {
-    os_unfair_lock_lock(&self->_lock);
+    std::lock_guard lock(_lock);
 
     // _getAttributesToReportWithReportedValues will log attribute paths reported
     [self _reportAttributes:[self _getAttributesToReportWithReportedValues:attributeReport]];
-
-    os_unfair_lock_unlock(&self->_lock);
 }
 
 #ifdef DEBUG
@@ -843,7 +823,7 @@
 
 - (void)_handleEventReport:(NSArray<NSDictionary<NSString *, id> *> *)eventReport
 {
-    os_unfair_lock_lock(&self->_lock);
+    std::lock_guard lock(_lock);
 
     NSDate * oldEstimatedStartTime = _estimatedStartTime;
     // Combine with previous unreported events, if they exist
@@ -937,14 +917,13 @@
         // save unreported events
         _unreportedEvents = reportToReturn;
     }
-
-    os_unfair_lock_unlock(&self->_lock);
 }
 
 - (NSDictionary<MTRClusterPath *, NSNumber *> *)_getCachedDataVersions
 {
     NSMutableDictionary<MTRClusterPath *, NSNumber *> * dataVersions = [NSMutableDictionary dictionary];
-    os_unfair_lock_lock(&self->_lock);
+    std::lock_guard lock(_lock);
+
     for (MTRAttributePath * path in _readCache) {
         NSDictionary * dataValue = _readCache[path];
         NSNumber * dataVersionNumber = dataValue[MTRDataVersionKey];
@@ -958,7 +937,6 @@
         }
     }
     MTR_LOG_INFO("%@ _getCachedDataVersions dataVersions count: %lu readCache count: %lu", self, static_cast<unsigned long>(dataVersions.count), static_cast<unsigned long>(_readCache.count));
-    os_unfair_lock_unlock(&self->_lock);
 
     return dataVersions;
 }
@@ -1083,11 +1061,12 @@
                            os_unfair_lock_lock(&self->_lock);
                            self->_currentReadClient = nullptr;
                            self->_currentSubscriptionCallback = nullptr;
-                           os_unfair_lock_unlock(&self->_lock);
+
                            dispatch_async(self.queue, ^{
                                // OnDone
                                [self _handleSubscriptionReset];
                            });
+                           os_unfair_lock_unlock(&self->_lock);
                        },
                        ^(void) {
                            MTR_LOG_DEFAULT("%@ got unsolicited message from publisher", self);
@@ -1855,18 +1834,16 @@
 
 - (void)_performScheduledExpirationCheck
 {
-    os_unfair_lock_lock(&self->_lock);
+    std::lock_guard lock(_lock);
 
     self.expirationCheckScheduled = NO;
     [self _checkExpiredExpectedValues];
-
-    os_unfair_lock_unlock(&self->_lock);
 }
 
 // Get attribute value dictionary for an attribute path from the right cache
 - (NSDictionary<NSString *, id> *)_attributeValueDictionaryForAttributePath:(MTRAttributePath *)attributePath
 {
-    os_unfair_lock_lock(&self->_lock);
+    std::lock_guard lock(_lock);
 
     // First check expected value cache
     NSArray * expectedValue = _expectedValueCache[attributePath];
@@ -1876,8 +1853,6 @@
             // expired - purge and fall through
             _expectedValueCache[attributePath] = nil;
         } else {
-            os_unfair_lock_unlock(&self->_lock);
-
             // not yet expired - return result
             return expectedValue[MTRDeviceExpectedValueFieldValueIndex];
         }
@@ -1886,8 +1861,6 @@
     // Then check read cache
     NSDictionary<NSString *, id> * cachedAttributeValue = _readCache[attributePath];
     if (cachedAttributeValue) {
-        os_unfair_lock_unlock(&self->_lock);
-
         return cachedAttributeValue;
     } else {
         // TODO: when not found in cache, generated default values should be used
@@ -1895,8 +1868,6 @@
             attributePath);
     }
 
-    os_unfair_lock_unlock(&self->_lock);
-
     return nil;
 }
 
@@ -2024,7 +1995,7 @@
 - (void)setAttributeValues:(NSArray<NSDictionary *> *)attributeValues reportChanges:(BOOL)reportChanges
 {
     MTR_LOG_INFO("%@ setAttributeValues count: %lu reportChanges: %d", self, static_cast<unsigned long>(attributeValues.count), reportChanges);
-    os_unfair_lock_lock(&self->_lock);
+    std::lock_guard lock(_lock);
 
     if (reportChanges) {
         [self _reportAttributes:[self _getAttributesToReportWithReportedValues:attributeValues]];
@@ -2040,8 +2011,6 @@
     if ([self _isCachePrimedWithInitialConfigurationData]) {
         _delegateDeviceCachePrimedCalled = YES;
     }
-
-    os_unfair_lock_unlock(&self->_lock);
 }
 
 - (BOOL)deviceCachePrimed
@@ -2166,7 +2135,7 @@
     MTR_LOG_INFO(
         "%@ Setting expected values %@ with expiration time %f seconds from now", self, values, [expirationTime timeIntervalSinceNow]);
 
-    os_unfair_lock_lock(&self->_lock);
+    std::lock_guard lock(_lock);
 
     // _getAttributesToReportWithNewExpectedValues will log attribute paths reported
     NSArray * attributesToReport = [self _getAttributesToReportWithNewExpectedValues:values
@@ -2175,24 +2144,22 @@
     [self _reportAttributes:attributesToReport];
 
     [self _checkExpiredExpectedValues];
-    os_unfair_lock_unlock(&self->_lock);
 }
 
 - (void)removeExpectedValuesForAttributePaths:(NSArray<MTRAttributePath *> *)attributePaths
                               expectedValueID:(uint64_t)expectedValueID
 {
-    os_unfair_lock_lock(&self->_lock);
+    std::lock_guard lock(_lock);
+
     for (MTRAttributePath * attributePath in attributePaths) {
         [self _removeExpectedValueForAttributePath:attributePath expectedValueID:expectedValueID];
     }
-    os_unfair_lock_unlock(&self->_lock);
 }
 
 - (void)removeExpectedValueForAttributePath:(MTRAttributePath *)attributePath expectedValueID:(uint64_t)expectedValueID
 {
-    os_unfair_lock_lock(&self->_lock);
+    std::lock_guard lock(_lock);
     [self _removeExpectedValueForAttributePath:attributePath expectedValueID:expectedValueID];
-    os_unfair_lock_unlock(&self->_lock);
 }
 
 - (void)_removeExpectedValueForAttributePath:(MTRAttributePath *)attributePath expectedValueID:(uint64_t)expectedValueID
diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm
index 7b7fd45..ae6669c 100644
--- a/src/darwin/Framework/CHIP/MTRDeviceController.mm
+++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm
@@ -46,6 +46,7 @@
 #import "MTRServerEndpoint_Internal.h"
 #import "MTRSetupPayload.h"
 #import "MTRTimeUtils.h"
+#import "MTRUnfairLock.h"
 #import "NSDataSpanConversion.h"
 #import "NSStringSpanConversion.h"
 #import <setup_payload/ManualSetupPayloadGenerator.h>
@@ -916,7 +917,7 @@
 
 - (MTRDevice *)deviceForNodeID:(NSNumber *)nodeID
 {
-    os_unfair_lock_lock(&_deviceMapLock);
+    std::lock_guard lock(_deviceMapLock);
     MTRDevice * deviceToReturn = _nodeIDToDeviceMap[nodeID];
     if (!deviceToReturn) {
         deviceToReturn = [[MTRDevice alloc] initWithNodeID:nodeID controller:self];
@@ -935,14 +936,13 @@
             [deviceToReturn setAttributeValues:attributesFromCache reportChanges:NO];
         }
     }
-    os_unfair_lock_unlock(&_deviceMapLock);
 
     return deviceToReturn;
 }
 
 - (void)removeDevice:(MTRDevice *)device
 {
-    os_unfair_lock_lock(&_deviceMapLock);
+    std::lock_guard lock(_deviceMapLock);
     auto * nodeID = device.nodeID;
     MTRDevice * deviceToRemove = _nodeIDToDeviceMap[nodeID];
     if (deviceToRemove == device) {
@@ -951,7 +951,6 @@
     } else {
         MTR_LOG_ERROR("Error: Cannot remove device %p with nodeID %llu", device, nodeID.unsignedLongLongValue);
     }
-    os_unfair_lock_unlock(&_deviceMapLock);
 }
 
 - (void)setDeviceControllerDelegate:(id<MTRDeviceControllerDelegate>)delegate queue:(dispatch_queue_t)queue
diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm
index 2ccf896..3d84a8f 100644
--- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm
+++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm
@@ -1121,10 +1121,8 @@
 
 - (NSArray<MTRDeviceController *> *)getRunningControllers
 {
-    os_unfair_lock_lock(&_controllersLock);
-    NSArray<MTRDeviceController *> * controllersCopy = [_controllers copy];
-    os_unfair_lock_unlock(&_controllersLock);
-    return controllersCopy;
+    std::lock_guard lock(_controllersLock);
+    return [_controllers copy];
 }
 
 - (nullable MTRDeviceController *)runningControllerForFabricIndex:(FabricIndex)fabricIndex
@@ -1196,9 +1194,8 @@
 
 - (void)removeServerEndpoint:(MTRServerEndpoint *)endpoint
 {
-    os_unfair_lock_lock(&_serverEndpointsLock);
+    std::lock_guard lock(_serverEndpointsLock);
     [_serverEndpoints removeObject:endpoint];
-    os_unfair_lock_unlock(&_serverEndpointsLock);
 }
 
 - (NSArray<MTRAccessGrant *> *)accessGrantsForFabricIndex:(chip::FabricIndex)fabricIndex clusterPath:(MTRClusterPath *)clusterPath
diff --git a/src/darwin/Framework/CHIP/MTRLogging.mm b/src/darwin/Framework/CHIP/MTRLogging.mm
index 23b310a..e552978 100644
--- a/src/darwin/Framework/CHIP/MTRLogging.mm
+++ b/src/darwin/Framework/CHIP/MTRLogging.mm
@@ -19,6 +19,7 @@
 #import "MTRLogging_Internal.h"
 
 #import "MTRFramework.h"
+#import "MTRUnfairLock.h"
 
 #import <algorithm>
 #import <atomic>
@@ -56,7 +57,7 @@
 {
     MTRFrameworkInit();
 
-    os_unfair_lock_lock(&logCallbackLock);
+    std::lock_guard lock(logCallbackLock);
     if (callback) {
         SetLogRedirectCallback(&MTRLogCallbackTrampoline);
         SetLogFilter(static_cast<LogCategory>(std::min(std::max(logTypeThreshold, MTRLogTypeError), MTRLogTypeDetail)));
@@ -66,5 +67,4 @@
         SetLogFilter(kLogCategory_None);
         SetLogRedirectCallback(nullptr);
     }
-    os_unfair_lock_unlock(&logCallbackLock);
 }
