Commits

Tuukka Norri  committed eed8677

I had misunderstood the use of common run loop modes, so reverted the changes
- Also fixed a bug in scheduling and unscheduling a CFHost from a run loop.

  • Participants
  • Parent commits 1edbe0f

Comments (0)

Files changed (5)

File Sources/BXConstants.h

 BX_EXPORT NSString* const kBXRelationshipsKey;
 BX_EXPORT NSString* const kBXPredicateKey;
 BX_EXPORT NSString* const kBXOwnerObjectVariableName;
-BX_EXPORT NSString* const kBXRunLoopCommonMode;
 
 BX_EXPORT NSString* const kBXErrorDomain;
 BX_EXPORT NSString* const kBXErrorMessageKey;

File Sources/BXConstants.m

 NSString* const kBXErrorDomain = @"kBXErrorDomain";
 NSString* const kBXErrorMessageKey = @"kBXErrorMessageKey";
 NSString* const kBXObjectKey = @"kBXObjectKey";
-
-NSString* const kBXRunLoopCommonMode = @"kBXRunLoopCommonMode";

File Sources/PGTSConnection.mm

 		{
 			mRunLoop = aRef;
 			CFRetain (mRunLoop);
-			CFRunLoopAddCommonMode (mRunLoop, (CFStringRef) kBXRunLoopCommonMode);
 		}
 	}
 }
 		
 		CFSocketDisableCallBacks (mSocket, kCFSocketWriteCallBack);
 		CFSocketEnableCallBacks (mSocket, kCFSocketReadCallBack);
-		CFRunLoopAddSource (mRunLoop, mSocketSource, (CFStringRef) kBXRunLoopCommonMode);
+		CFRunLoopAddSource (mRunLoop, mSocketSource, (CFStringRef) kCFRunLoopCommonModes);
 		
-		[self beginTrackingNetworkStatusIn: mRunLoop mode: (CFStringRef) kBXRunLoopCommonMode];
+		[self beginTrackingNetworkStatusIn: mRunLoop mode: (CFStringRef) kCFRunLoopCommonModes];
 		
 		if (0 < [mQueue count])
 			[self sendNextQuery];

File Sources/PGTSConnectionMonitor.m

 		if (mIOPowerSession)
 		{
 			CFRunLoopRef rl = CFRunLoopGetCurrent ();
-			CFRunLoopAddCommonMode (rl, (CFStringRef) kBXRunLoopCommonMode);
-			CFRunLoopAddSource (rl, IONotificationPortGetRunLoopSource (ioNotificationPort), (CFStringRef) kBXRunLoopCommonMode);
+			CFRunLoopAddSource (rl, IONotificationPortGetRunLoopSource (ioNotificationPort), (CFStringRef) kCFRunLoopCommonModes);
 		}
 		else
 		{

File Sources/PGTSConnector.m

 ScheduleHost (CFHostRef theHost, CFRunLoopRef theRunLoop)
 {
 	if (theHost && theRunLoop)
-		CFHostUnscheduleFromRunLoop (theHost, theRunLoop, (CFStringRef) kBXRunLoopCommonMode);
+		CFHostScheduleWithRunLoop (theHost, theRunLoop, (CFStringRef) kCFRunLoopCommonModes);
 }
 
 
 UnscheduleHost (CFHostRef theHost, CFRunLoopRef theRunLoop)
 {
 	if (theHost && theRunLoop)
-		CFHostScheduleWithRunLoop (theHost, theRunLoop, (CFStringRef) kBXRunLoopCommonMode);
+		CFHostUnscheduleFromRunLoop (theHost, theRunLoop, (CFStringRef) kCFRunLoopCommonModes);
 }
 
 
 		{
 			mRunLoop = aRef;
 			CFRetain (mRunLoop);
-			CFRunLoopAddCommonMode (mRunLoop, (CFStringRef) kBXRunLoopCommonMode);
 		}
 	}
 }
 	CFSocketDisableCallBacks (mSocket, kCFSocketReadCallBack);
 	CFSocketEnableCallBacks (mSocket, kCFSocketWriteCallBack);
 	mExpectedCallBack = kCFSocketWriteCallBack;
-	CFRunLoopAddSource (mRunLoop, mSocketSource, (CFStringRef) kBXRunLoopCommonMode);
+	CFRunLoopAddSource (mRunLoop, mSocketSource, (CFStringRef) kCFRunLoopCommonModes);
 }
 @end