有一个返回int的函数,如何使用boost在单独的线程中运行它? [英] Having a function that returns int how can I run it in a separate thread using boost?

查看:68
本文介绍了有一个返回int的函数,如何使用boost在单独的线程中运行它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这看起来没有必要,但我希望它可以帮助我发现内存泄漏. 因此,在一个返回int的类中有一个函数,如何从该类的另一个函数中调用它(调用它,使返回int的函数将在另一个线程中运行)?

I know it looks not necessary but I hope that it would help me find memory leak. So having a function inside a class that returns int, how can I call it from another function of that class (call it so that function that returns int would run in another thread)?

推荐答案

操作系统将不会回收工作线程中的内存泄漏.那不是它的工作原理.

The operating system will not reclaim memory leaks in worker threads. That's not how it works.

修复您的错误.世界不再需要任何糟糕的软件.

Fix your bugs. The world doesn't need any more crappy software.

这篇关于有一个返回int的函数,如何使用boost在单独的线程中运行它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆