Ejemplo n.º 1
0
            private static async Task <bool> OnRelease(ArenaSession s)
            {
                var l = s.GetLock();

                try
                {
                    using (var t = EndSession(s))
                    {
                        if (await t)
                        {
                            lock (sessions)
                            {
                                if (s._locks == 0)
                                {
                                    s.Session = null;
                                    sessions.Remove(s.Email);
                                    s.Dispose();

                                    return(true);
                                }
                            }
                        }
                    }
                }
                catch (Exception e)
                {
                    Util.Logging.Log(e);
                }
                finally
                {
                    l.Dispose();
                }

                return(false);
            }