Skip to content

Commit

Permalink
added iOS thread sleep possibilities
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Keller committed Feb 6, 2014
1 parent 545e0b9 commit 11e0331
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion VDKQueue.m
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ - (void) watcherThread:(id)sender;


@implementation VDKQueue
@synthesize delegate = _delegate, alwaysPostNotifications = _alwaysPostNotifications;
@synthesize delegate = _delegate, alwaysPostNotifications = _alwaysPostNotifications, sleepInterval = _sleepInterval;



Expand All @@ -135,6 +135,11 @@ - (id) init
}

_alwaysPostNotifications = NO;
#if TARGET_OS_IPHONE
_sleepInterval = 60;
#else
_sleepInterval = 0;
#endif
_watchedPathEntries = [[NSMutableDictionary alloc] init];
}
return self;
Expand Down Expand Up @@ -333,6 +338,9 @@ - (void) watcherThread:(id)sender
{
NSLog(@"Error in VDKQueue watcherThread: %@", localException);
}
#if TARGET_OS_IPHONE
[NSThread sleepForTimeInterval:_sleepInterval]; // To save power on iOS
#endif
}

// Close our kqueue's file descriptor
Expand Down

0 comments on commit 11e0331

Please sign in to comment.