02 2023 档案
摘要:本篇文章我们用Go封装一个介入式的双向链表,目的是将链表的实现和具体元素解耦。文章参考自:https://github.com/brewlin/net-protocol 1.元素的接口 type Element interface { Next() Element Prev() Element Se
阅读全文
摘要:本篇文章我们用Go封装一个无等待锁库。文章参考自:https://github.com/brewlin/net-protocol 1.锁的封装 type Mutex struct { v int32 ch chan struct{} } 2.锁的初始化 func (m *Mutex) Init()
阅读全文