title: What does "UIBackgroundTaskInvalid" mean?
body: <p>I'm developing iPhone app which runs in the background(iOS4), and refer "Completing a Finite Length Task in the Background" written by Apple at the following url</p>
  
  <p><a href="http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html#//apple_ref/doc/uid/TP40007072-CH5" rel="nofollow">http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html#//apple_ref/doc/uid/TP40007072-CH5</a></p>
  
  <p>Then I've been able to implement background tasks.
  (Of course, I see that application has 10min time limitaiton.)
  However, I still can't understand what "<code>bgTask = UIBackgroundTaskInvalid;</code>"(Line7,16 of Listing 4-2) means.</p>
  
  <p>In my opinion, the line shown above has never been reached.
  Because there is "<code>endBackgroundTask:</code>" before that and the background task will be ended.
  In fact, when I checked with xcode debugger, this thought may be true and not reach at Line7, 16.</p>
  
  <p>If so, is this line redundant?
  Or is there any reason to have to be written?</p>
  
  <p>I would appreciate any help about this.
  Thanks in advance.</p>