我们这里遇到的情况叫做竞态条件(race condition),是一种出错概率非常小的条件,意味着您只有非常快速或者非常运气不好才会遇到这种情况。
What you have here is called a "race condition," a condition where something can go wrong only during a small window, meaning that you have to be pretty fast, or pretty unlucky, to see the problem.
在Linux中它们都得不到很好的支持(虽然对于较新的USB 2.0驱动器,您的运气可能会好一些)。
Neither is well-supported in Linux (although you might have better luck with the newer USB 2.0 drives).
程序中断,并弹出“对不起,您运气不好”的消息或打印出堆栈跟踪,这不是错误处理,而是错误报告。
Crashing, spitting out a "sorry, you're out of luck" message, or printing out a stack trace is not error handling. That is error reporting.
应用推荐