title: How to check task status in c#
body: <p>I'd like to know how can i check status of an asynchronous task in c#.
  I have a save method to save users, and i'd like to run a background task to update them after the save.</p>
  
  <p>I'm in framework 4.0, here is my code to begin the task</p>
  
  <pre><code> System.Threading.Tasks.Task task = null;
   task = System.Threading.Tasks.Task.Factory.StartNew(() =&gt;
         {                   
               beginTask();
         });
  </code></pre>
  
  <p>My problem is the task take some times to end (near 7 mins) so if someone do several user saves, the task is runned several times, so i'd like to check before running the task if the function beginTask() is already running to avoid to have a lot of background tasks are running.</p>
  
  <p>Thanks</p>