本文介绍了使输出流线程安全.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个使用WriteFile()直接写入控制台的应用程序(我的),但我还必须与另一个应用程序共享该控制台(据我所知,它写入stdout).有人知道我可以强制输出同步的方法吗?这样就不会出现输出重叠/损坏的情况.我的应用程序使用控制台锁来防止这种情况发生-但是我无法控制第三方应用程序.
问候.
James
I have an application (mine) that uses WriteFile() to write directly to the console, but I also have to share that console with another application that (as far as I know writes to stdout). Does anybody know of a way that I can force synchronisation of the output - so that there is no output overlap/corruption. My application uses a console lock to prevent this happening - but I have no control over a third-party app.
Regards.
James
推荐答案
这篇关于使输出流线程安全.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!