summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxant <xant@dyne.org>2012-06-15 00:40:32 (GMT)
committer xant <xant@dyne.org>2012-06-15 00:40:32 (GMT)
commit9074fc77665efef7f9e7598a14dd6a701050dc4b (patch)
tree58e2ede9dc37e2456f9dfea4ba2f1336cbe5955f
parentc7af171f18faf86d3afa07d005b03c0a5760836d (diff)
no need to use locks when OSAtomicIncrement32 is being used
-rw-r--r--core/JMXPin.mm14
1 files changed, 6 insertions, 8 deletions
diff --git a/core/JMXPin.mm b/core/JMXPin.mm
index b2e6805..4f52584 100644
--- a/core/JMXPin.mm
+++ b/core/JMXPin.mm
@@ -588,14 +588,12 @@ using namespace v8;
// and propagate the signal if that's the case
if ([self isValidData:data]) {
id currentData = nil;
- @synchronized(self) {
- UInt32 currentOffset = offset&kJMXPinDataBufferMask;
- UInt32 nextOffset = (offset+1)&kJMXPinDataBufferMask;
- currentData = dataBuffer[currentOffset];
- dataBuffer[nextOffset] = [data retain];
- OSAtomicIncrement32(&offset);
- dataBuffer[currentOffset] = nil;
- }
+ UInt32 currentOffset = offset&kJMXPinDataBufferMask;
+ UInt32 nextOffset = (offset+1)&kJMXPinDataBufferMask;
+ currentData = dataBuffer[currentOffset];
+ dataBuffer[nextOffset] = [data retain];
+ OSAtomicIncrement32(&offset);
+ dataBuffer[currentOffset] = nil;
[currentData autorelease];
if (sender)
currentSender = sender;