IReferenceCounted DotNetty.Common

 1 // Copyright (c) Microsoft. All rights reserved.
 2 // Licensed under the MIT license. See LICENSE file in the project root for full license information.
 3
 4 namespace DotNetty.Common
 5 {
 6     /// <summary>
 7     /// 引用计数的可复用对象的接口
 8     /// </summary>
 9     public interface IReferenceCounted
10     {
11         /// <summary>
12         /// 返回此对象的引用计数
13         /// </summary>
14         int ReferenceCount { get; }
15
16         /// <summary>
17         /// 保留 引用计数 +1
18         /// </summary>
19         IReferenceCounted Retain();
20
21         /// <summary>
22         ///  增加引用计数   <see cref="increment" />.
23         /// </summary>
24         IReferenceCounted Retain(int increment);
25
26         /// <summary>
27         ///   触摸 为调试目的,记录当前对象的访问位置。
28         ///   如果这个对象是确定被泄露,信息记录这一操作
29         /// </summary>
30         /// <returns></returns>
31         IReferenceCounted Touch();
32
33         /// <summary>
34         ///     记录该对象的当前访问的位置,用于调试目的额外的任意信息。
35         ///     如果该对象被确定为泄漏,此操作记录的信息将通过 资源泄漏检测器 <see cref="ResourceLeakDetector" /> 提供给您
36         ///
37         /// </summary>
38         IReferenceCounted Touch(object hint);
39
40         /// <summary>
41         ///   减少引用计数1和释放该对象的引用计数达到0时。
42         /// </summary>
43         /// <returns>true :当且仅当引用计数为0,此对象已经被释放</returns>
44         bool Release();
45
46         /// <summary>
47         ///  减少引用计数,释放该对象如果引用计数为0时 <see cref="decrement" />
48         /// </summary>
49         /// <returns>true 当且仅当引用计数为0,此对象已被释放</returns>
50         bool Release(int decrement);
51     }
52 }
时间: 2024-08-06 07:54:16

IReferenceCounted DotNetty.Common的相关文章

DotNetty 跨平台的网络通信库

长久以来,.Net开发人员都非常羡慕Java有Netty这样,高效,稳定又易用的网络通信基础框架.终于微软的Azure团队,使用C#实现的Netty的版本发布.不但使用了C#和.Net平台的技术特点,并且保留了Netty原来绝大部分的编程接口.让我们在使用时,完全可以依照Netty官方的教程来学习和使用DotNetty应用程序.DotNetty同时也是开源的,它的源代码托管在Github上:https://github.com/azure/dotnetty 0x01 项目预览 从github上下

通信传输利器Netty(Net is DotNetty)介绍

(先埋怨一下微软大大)我们做NET开发,十分羡慕JAVA上能有NETTY, SPRING, STRUTS, DUBBO等等优秀框架,而我们NET就只有干瞪眼,哎,无赖之前生态圈没做好,恨铁不成钢啊.不过由于近来Net Core的发布,慢慢也拉回了一小部分属于微软的天下,打住,闲话扯到这儿. DotNetty是Azure团队仿照(几乎可以这么说)JAVA的Netty而出来的(目前已实现Netty的一部分),目前在Github上的Star有1.8K+,地址:https://github.com/Az

Longest Common Subsequence

Problem statement: Given two strings, find the longest common subsequence (LCS). Your code should return the length of LCS. Have you met this question in a real interview? Yes Clarification What's the definition of Longest Common Subsequence? https:/

ANSI Common Lisp Chapter 2

Chapter 2 总结 (Summary) Lisp 是一种交互式语言.如果你在顶层输入一个表达式, Lisp 会显示它的值. Lisp 程序由表达式组成.表达式可以是原子,或一个由操作符跟着零个或多个实参的列表.前序表示法代表操作符可以有任意数量的实参. Common Lisp 函数调用的求值规则: 依序对实参从左至右求值,接着把它们的值传入由操作符表示的函数. quote 操作符有自己的求值规则,它完封不动地返回实参. 除了一般的数据类型, Lisp 还有符号跟列表.由于 Lisp 程序是

14. Longest Common Prefix

Write a function to find the longest common prefix string amongst an array of strings. 这个问题是关于如何寻找字符串数组的公共前缀的,从第一个字母开始,只要共有的都要输出. 思路: 1.首先,如何得到字符串共有前缀,既然共有,那么很容易先想到最短字符串. 2.最短字符串和其余进行比较,这样就省下了大于最短字符串长度的比较. 3.关于字符串的操作,length和null是很必要的判断输入操作,千万别忘记! 4.关

235. Lowest Common Ancestor of a Binary Search Tree

1. 问题描述 Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes v and w as the lowest node in T th

Lowest Common Ancestor of a Binary Search Tree

1. Title 235. Lowest Common Ancestor of a Binary Search Tree 2. Http address https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/ 3. The question Given a binary search tree (BST), find the lowest common ancestor (LCA) of two

bzoj1968【AHOI2005】COMMON 约数研究

1968: [Ahoi2005]COMMON 约数研究 Time Limit: 1 Sec  Memory Limit: 64 MB Submit: 1492  Solved: 1139 [Submit][Status][Discuss] Description Input 只有一行一个整数 N(0 < N < 1000000). Output 只有一行输出,为整数M,即f(1)到f(N)的累加和. Sample Input 3 Sample Output 5 HINT Source Day2

Lowest Common Ancestor of a Binary Tree

题目连接 https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/ Common Ancestor of a Binary Tree Description Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the definition of LCA on