Comments (3)
打个补丁就行了,这个是RingBuffer对象实现修改过了 之前的老test程序不完全匹配。
这个bug的是因为EventPoller对象会在自己线程中删除自己,相当thread对象绑定的线程中删除thread对象本身,
原因由于RingReader对象会保持EventPoller对象的强引用,在其析构时,会发个任务给EventPoller,如果此时main函数推出了,
那么只有EventPoller线程会保持它自己的引用,从而在他自己的线程中释放自己。
Index: tests/test_ringBuffer.cpp
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- tests/test_ringBuffer.cpp (revision 7ae5f547c17ddc7bee7b82ebc114248df99de620)
+++ tests/test_ringBuffer.cpp (date 1609754428000)
@@ -85,6 +85,7 @@
//释放环形缓冲,此时触发Detach事件
g_ringBuf.reset();
+ ringReader.reset();
sleep(1);
return 0;
}
from zltoolkit.
修改后程序不异常退出了,但是Detach事件
也不会触发了。
from zltoolkit.
嗯 现在detach和onread事件都是异步了 所以这样。 ringReader.reset();放在 sleep(1);后面吧。
这个代码现在不怎么通用了 完全是给zlmediakit特化定制的了
from zltoolkit.
Related Issues (20)
- BUG反馈
- sslbox mbedtls 支持 HOT 5
- 您好,请教下我将 libzltoolkit.a 和libzlmediakit.a 静态库加到项目中,编译后报错 HOT 2
- 关于SocketSender中的send 方法不用的问题。 HOT 3
- CPU占用很高,定位到这里 HOT 14
- Timer实现是否存在缺陷 HOT 7
- ThreadPool.h 中线程优先级设置问题 HOT 9
- Socket::flushData函数,多线程数据发送顺序问题 HOT 3
- 服务重新启动,客户端重连bug HOT 5
- static_pointer_cast的使用 HOT 1
- 测试发现Tcpserver运行过程中会崩溃 HOT 7
- UdpServer clone策略问题 HOT 12
- [BUG] onAccept异常出现了write事件 HOT 2
- 进程(调用Debug版版本库)退出时异常 HOT 9
- 多个线程打印同一个日志时,由于日志优化会导致写的日志不对 HOT 1
- ssl 支持多线程 问题求助 HOT 2
- Threadpool的cpu负载统计好像有问题 HOT 1
- udp数据可能被误读 HOT 1
- QQ群没有找到
- error C2988: 不可识别的模板声明/定义 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zltoolkit.