当前位置:首页>java>常见的死锁场景,你的代码中了几个?

常见的死锁场景,你的代码中了几个?

  • 2026-02-01 07:09:39
常见的死锁场景,你的代码中了几个?

嘿,小伙伴们,我是小康 👋

说实话,死锁是多线程编程中最让人头疼的Bug之一。它不像段错误那样会立即崩溃,而是悄无声息地让程序"卡死",CPU不高、内存不涨,就是不动了...

今天,我就来盘点一下实战中最常见的7种死锁场景,看看你的代码中了几个?

场景1:经典的锁顺序不一致

这是最经典、也是最常见的死锁场景。

💀 问题代码

std::mutex mtx1, mtx2;voidthread1_func(){std::lock_guard<std::mutex> lock1(mtx1);  // 先锁mtx1std::this_thread::sleep_for(std::chrono::milliseconds(100));std::lock_guard<std::mutex> lock2(mtx2);  // 再锁mtx2// 业务逻辑...}voidthread2_func(){std::lock_guard<std::mutex> lock2(mtx2);  // 先锁mtx2std::this_thread::sleep_for(std::chrono::milliseconds(100));std::lock_guard<std::mutex> lock1(mtx1);  // 再锁mtx1// 业务逻辑...}

死锁原因:线程1持有mtx1等待mtx2,线程2持有mtx2等待mtx1,形成循环等待。

✅ 正确解决方案

方案1:统一加锁顺序

voidsafe_thread_func(){// 所有线程都按照 mtx1 -> mtx2 的顺序加锁std::lock_guard<std::mutex> lock1(mtx1);std::lock_guard<std::mutex> lock2(mtx2);// 业务逻辑...}

方案2:使用 std::lock 原子获取多锁(推荐)

voidsafe_thread_func(){std::lock(mtx1, mtx2);  // 原子地同时获取两个锁std::lock_guard<std::mutex> lock1(mtx1, std::adopt_lock);std::lock_guard<std::mutex> lock2(mtx2, std::adopt_lock);// 业务逻辑...}

方案3:使用 std::scoped_lock(C++17,最推荐)

voidsafe_thread_func(){std::scoped_lock lock(mtx1, mtx2);  // 自动按顺序加锁,RAII管理// 业务逻辑...}

场景2:忘记解锁导致的死锁

这个错误看似低级,但在实际项目中出现频率相当高!

💀 问题代码

std::mutex mtx;voidprocess_data(){    mtx.lock();if (some_error_condition) {return;  // 糟糕!忘记unlock就返回了    }// 业务逻辑...    mtx.unlock();}

死锁原因:第一个线程触发了提前返回,锁没有释放,后续所有线程都会永久阻塞。

✅ 正确解决方案

永远使用RAII管理锁,不要手动lock/unlock

voidsafe_process_data(){std::lock_guard<std::mutex> lock(mtx);  // 自动管理,异常安全if (some_error_condition) {return;  // lock_guard析构时会自动unlock    }// 业务逻辑...}  // 离开作用域自动unlock

场景3:递归锁的误用

同一个线程对同一个普通mutex多次加锁会死锁!

💀 问题代码

std::mutex mtx;voidfunc_a(){std::lock_guard<std::mutex> lock(mtx);// 业务逻辑...    func_b();  // 调用func_b}voidfunc_b(){std::lock_guard<std::mutex> lock(mtx);  // 再次锁同一个mutex,死锁!// 业务逻辑...}

死锁原因:std::mutex不支持递归加锁,同一线程第二次lock会阻塞自己。

✅ 正确解决方案

方案1:使用递归锁

std::recursive_mutex mtx;  // 改用递归锁voidfunc_a(){std::lock_guard<std::recursive_mutex> lock(mtx);    func_b();  // 可以再次加锁,不会死锁}voidfunc_b(){std::lock_guard<std::recursive_mutex> lock(mtx);// 业务逻辑...}

方案2:重构代码,避免递归锁(更推荐)

std::mutex mtx;voidfunc_a(){std::lock_guard<std::mutex> lock(mtx);// 业务逻辑...    func_b_internal();  // 调用不加锁的内部函数}voidfunc_b(){std::lock_guard<std::mutex> lock(mtx);    func_b_internal();}voidfunc_b_internal(){// 实际的业务逻辑,不加锁// 调用者保证已经持有锁}

场景4:条件变量的死锁陷阱

条件变量使用不当也会导致死锁,这个很多人不知道!

💀 问题代码

std::mutex mtx;std::condition_variable cv;bool ready = false;// 生产者voidproducer(){    ready = true;  // 没有在锁保护下修改共享变量!    cv.notify_one();}// 消费者voidconsumer(){std::unique_lock<std::mutex> lock(mtx);    cv.wait(lock, []{ return ready; });  // 可能永久等待!// 业务逻辑...}

死锁原因:如果notify_one()wait()之前发生,通知会丢失,消费者永久等待。

✅ 正确解决方案

共享变量的修改必须在mutex保护下进行

std::mutex mtx;std::condition_variable cv;bool ready = false;// 生产者voidproducer(){    {std::lock_guard<std::mutex> lock(mtx);        ready = true;  // 在锁保护下修改    }    cv.notify_one();  // 可以在锁外通知(性能更好)}// 消费者voidconsumer(){std::unique_lock<std::mutex> lock(mtx);    cv.wait(lock, []{ return ready; });  // 即使通知先到,也能检测到ready为true// 业务逻辑...}

场景5:线程join引起的死锁

没有锁也能死锁?是的!thread::join()也可能导致死锁。

💀 问题代码

std::thread t1, t2;voidthread1_func(){// 业务逻辑...    t2.join();  // 等待t2结束}voidthread2_func(){// 业务逻辑...    t1.join();  // 等待t1结束}intmain(){    t1 = std::thread(thread1_func);    t2 = std::thread(thread2_func);// 两个线程互相等待,死锁!    t1.join();    t2.join();}

死锁原因:t1在等t2结束,t2在等t1结束,形成循环等待。

✅ 正确解决方案

不要让线程互相join,在主线程统一管理

std::thread t1, t2;voidthread1_func(){// 业务逻辑,不join其他线程}voidthread2_func(){// 业务逻辑,不join其他线程}intmain(){    t1 = std::thread(thread1_func);    t2 = std::thread(thread2_func);// 在主线程按顺序join    t1.join();    t2.join();}

场景6:持锁时间过长导致的隐性死锁

这种场景不是真正的死锁,但会让程序"看起来像死锁"。

💀 问题代码

std::mutex io_mutex;voidthread_func(){std::lock_guard<std::mutex> lock(io_mutex);// 持锁期间做耗时操作std::cout << "Processing..." << std::endl;std::this_thread::sleep_for(std::chrono::seconds(10));  // 模拟耗时操作// 其他线程会长时间阻塞}

问题:虽然不是死锁,但其他线程会长时间等待,影响性能。

✅ 正确解决方案

缩小临界区,减少持锁时间

std::mutex io_mutex;voidthread_func(){// 耗时操作放在锁外std::this_thread::sleep_for(std::chrono::seconds(10));// 只在必要时加锁    {std::lock_guard<std::mutex> lock(io_mutex);std::cout << "Processing..." << std::endl;    }  // 尽快释放锁}

场景7:对象交换时的死锁(高级场景)

这是一个非常隐蔽的死锁场景,经常出现在需要交换两个对象数据的情况下。

💀 问题代码

classAccount {mutablestd::mutex mtx;int balance;public:voidtransfer(Account& to, int amount){std::lock_guard<std::mutex> lock1(this->mtx);  // 锁自己std::lock_guard<std::mutex> lock2(to.mtx);     // 锁对方this->balance -= amount;        to.balance += amount;    }};// 使用Account acc1, acc2;std::thread t1([&]{ acc1.transfer(acc2, 100); });  // acc1 -> acc2std::thread t2([&]{ acc2.transfer(acc1, 50); });   // acc2 -> acc1,死锁!

死锁原因:t1锁定acc1再锁acc2,t2锁定acc2再锁acc1,顺序相反。

✅ 正确解决方案

使用唯一ID确定加锁顺序

classAccount {staticstd::atomic<unsignedint> next_id;constunsignedint id;mutablestd::mutex mtx;int balance;public:    Account() : id(next_id++), balance(0) {}voidtransfer(Account& to, int amount){if (this == &to) return;  // 防止自己给自己转账// 根据ID决定加锁顺序std::mutex* first = (this->id < to.id) ? &this->mtx : &to.mtx;std::mutex* second = (this->id < to.id) ? &to.mtx : &this->mtx;std::lock_guard<std::mutex> lock1(*first);std::lock_guard<std::mutex> lock2(*second);this->balance -= amount;        to.balance += amount;    }};std::atomic<unsignedint> Account::next_id{0};

更简洁的方案(C++17)

voidtransfer(Account& to, int amount){if (this == &to) return;// std::scoped_lock会自动按地址排序加锁std::scoped_lock lock(this->mtx, to.mtx);this->balance -= amount;    to.balance += amount;}

📝 避免死锁的黄金法则

总结一下,要避免死锁,记住这些原则:

  1. 使用RAII管理锁: 永远用lock_guardscoped_lock,不要手动lock/unlock
  2. 统一加锁顺序: 多个锁时,保证全局加锁顺序一致
  3. 使用std::lockstd::scoped_lock:原子获取多个锁,避免顺序问题
  4. 避免嵌套锁:尽量一次只持有一个锁
  5. 缩小临界区:减少持锁时间,降低死锁概率
  6. 条件变量要正确使用:共享变量的修改必须在mutex保护下
  7. 不要循环等待:避免线程间互相join

🎯 想彻底解决死锁问题?

手动避免死锁虽然重要,但在复杂项目中,人工检查很容易遗漏。这时候就需要自动化的死锁检测工具!

我最近开发了一个DeadLock-Sentinel 死锁检测工具,可以:

  • ✅ 自动检测任意复杂的死锁场景
  • ✅ 精确定位到源代码行号
  • ✅ 显示完整的函数调用栈
  • ✅ 零侵入集成,只需改类型名

感兴趣的话,加我微信 jkfwdkf,备注「死锁检测

或者扫描下方二维码


如果这篇文章对你有帮助,记得点赞、在看、转发三连!🔥

你的项目中遇到过哪些死锁场景?欢迎在评论区分享你的踩坑经历! 👇

END

作者:xiaokang1998

来源:跟着小康学编程

版权归原作者所有,如有侵权,请联系删除
推荐阅读
嵌入式状态机架构,一文讲透!
造福无数程序员的技术,被无情地抛弃了…
用了6年的米家吹风筒罢工了,寿命瓶颈原来在这里
→点关注,不迷路←

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-08 19:57:16 HTTP/2.0 GET : https://f.mffb.com.cn/a/462604.html
  2. 运行时间 : 0.143081s [ 吞吐率:6.99req/s ] 内存消耗:4,411.35kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=c502390d397843220a73c535ef3f8284
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000727s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001104s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.000492s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.000295s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.000546s ]
  6. SELECT * FROM `set` [ RunTime:0.000374s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.000739s ]
  8. SELECT * FROM `article` WHERE `id` = 462604 LIMIT 1 [ RunTime:0.006811s ]
  9. UPDATE `article` SET `lasttime` = 1770551836 WHERE `id` = 462604 [ RunTime:0.009827s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 65 LIMIT 1 [ RunTime:0.002488s ]
  11. SELECT * FROM `article` WHERE `id` < 462604 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.013749s ]
  12. SELECT * FROM `article` WHERE `id` > 462604 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.009749s ]
  13. SELECT * FROM `article` WHERE `id` < 462604 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.009488s ]
  14. SELECT * FROM `article` WHERE `id` < 462604 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.001710s ]
  15. SELECT * FROM `article` WHERE `id` < 462604 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.016234s ]
0.145207s