(fix) rename the start var to avoid potential SOPE confusion

This commit is contained in:
Ludovic Marcotte
2016-04-07 14:22:17 -04:00
parent 1615545584
commit 2115c46fbb
3 changed files with 13 additions and 7 deletions

View File

@@ -1906,7 +1906,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// We enter our loop detection change
for (i = 0; i < (heartbeatInterval/internalInterval); i++)
{
if (shouldTerminate)
if ([self easShouldTerminate])
break;
s = [NSMutableString string];
@@ -1948,7 +1948,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
{
total_sleep = 0;
while (!shouldTerminate && total_sleep < internalInterval)
while (![self easShouldTerminate] && total_sleep < internalInterval)
{
// We check if we must break the current synchronization since an other Sync
// has just arrived.

View File

@@ -37,7 +37,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@class NSURL;
@class NSNumber;
static volatile BOOL shouldTerminate = NO;
static volatile BOOL easShouldTerminate = NO;
@interface SOGoActiveSyncDispatcher : NSObject
{
@@ -63,5 +63,6 @@ static volatile BOOL shouldTerminate = NO;
- (NSURL *) folderTableURL;
- (void) ensureFolderTableExists;
- (BOOL) easShouldTerminate;
@end

View File

@@ -149,7 +149,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
void handle_eas_terminate(int signum)
{
NSLog(@"Forcing termination of EAS loop.");
shouldTerminate = YES;
easShouldTerminate = YES;
[[WOCoreApplication application] terminateAfterTimeInterval: 1];
}
@@ -171,7 +171,7 @@ void handle_eas_terminate(int signum)
imapFolderGUIDS = nil;
syncRequest = nil;
shouldTerminate = NO;
easShouldTerminate = NO;
signal(SIGTERM, handle_eas_terminate);
return self;
@@ -2139,7 +2139,7 @@ void handle_eas_terminate(int signum)
// We enter our loop detection change
for (i = 0; i < (heartbeatInterval/internalInterval); i++)
{
if (shouldTerminate)
if (easShouldTerminate)
break;
pool = [[NSAutoreleasePool alloc] init];
@@ -2179,7 +2179,7 @@ void handle_eas_terminate(int signum)
{
total_sleep = 0;
while (!shouldTerminate && total_sleep < internalInterval)
while (!easShouldTerminate && total_sleep < internalInterval)
{
// We check if we must break the current ping request since an other ping request
// has just arrived.
@@ -3452,4 +3452,9 @@ void handle_eas_terminate(int signum)
[cm releaseChannel: channel];
}
- (BOOL) easShouldTerminate
{
return easShouldTerminate;
}
@end