Created
April 3, 2013 20:21
-
-
Save ntotten/5304862 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public FacebookClient(string appSecret, string appId) | |
{ | |
SendAnalytics(); | |
} | |
private static bool AnaltyicsSent = false; | |
private static object AnalyticsLock = new object(); | |
private void SendAnalytics() | |
{ | |
System.Threading.Tasks.Task.Factory.StartNew(() => | |
{ | |
try | |
{ | |
if (!AnaltyicsSent) | |
{ | |
lock (AnalyticsLock) | |
{ | |
if (!AnaltyicsSent) | |
{ | |
// Make call | |
} | |
} | |
} | |
} | |
catch { } | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment