{"id":5766,"date":"2024-01-25T16:14:25","date_gmt":"2024-01-25T08:14:25","guid":{"rendered":"https:\/\/blog.qdac.cc\/?p=5766"},"modified":"2024-01-25T16:14:25","modified_gmt":"2024-01-25T08:14:25","slug":"%e6%95%99%e7%a8%8b%e5%a6%82%e4%bd%95%e4%bf%9d%e8%af%81%e5%af%b9%e8%b1%a1%e9%87%8a%e6%94%be%e6%97%b6%ef%bc%8c%e5%bc%82%e6%ad%a5%e8%b0%83%e7%94%a8%e8%bf%87%e7%a8%8b%e9%83%bd%e5%b7%b2%e7%bb%8f%e5%ae%8c","status":"publish","type":"post","link":"https:\/\/blog.qdac.cc\/?p=5766","title":{"rendered":"[\u6559\u7a0b]\u5982\u4f55\u4fdd\u8bc1\u5bf9\u8c61\u91ca\u653e\u65f6\uff0c\u5f02\u6b65\u8c03\u7528\u8fc7\u7a0b\u90fd\u5df2\u7ecf\u5b8c\u6210"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>[\u57fa\u672c\u539f\u7406]<\/strong><\/h2>\n\n\n\n<p>\u6211\u4eec\u4f7f\u7528\u4e00\u4e2a\u5f15\u7528\u8ba1\u6570\u53ef\u4ee5\u5f88\u7b80\u5355\u7684\u5b8c\u6210\u8fd9\u4e00\u9700\u6c42\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5728\u89e6\u53d1\u5f02\u6b65\u64cd\u4f5c\u65f6\uff0c\u5c06\u6b64\u8ba1\u6570\u52a0 1\uff1b<\/li>\n\n\n\n<li>\u5728\u5f02\u6b65\u64cd\u4f5c\u6267\u884c\u5b8c\u6210\u65f6\uff0c\u5c06\u6b64\u8ba1\u6570\u51cf 1\uff1b<\/li>\n\n\n\n<li>\u5728\u5bf9\u8c61\u91ca\u653e\u524d\uff0c\u68c0\u67e5\u8fd9\u4e2a\u8ba1\u6570\u662f\u5426\u4e3a0\uff0c\u5982\u679c\u4e0d\u4e3a0\uff0c\u5219\u7b49\u5f85\u8ba1\u6570\u53d8\u4e3a0\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">[\u5b9e\u73b0\u7ec6\u8282]<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>type\n   TTestObject=class\n   private\n     FAsyncRefCount:Integer;\n     procedure DoAsync;\n   public\n     destructor Destroy;override;\n   end;\n...\n\nprocedure TTestObject.DoAsync;\nbegin\n  Inc(FAsyncRefCount);\n  TThread.ForceQueue(nil,\n    procedure\n    begin\n      Dec(FAsyncRefCount);\n      ...\n    end);\nend;\n\ndestructor TTestObject.Destroy;\nbegin\n  \/\/\u5728\u6b64\u68c0\u67e5\uff0c\u4fdd\u8bc1\u5f02\u6b65\u8c03\u7528\u5b8c\u6210\u624d\u771f\u6b63\u91ca\u653e\n  while FAsyncRefCount>0 do\n    CheckSynchronize(0);\n  ...\n  inherited;\nend;<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>[\u8fdb\u4e00\u6b65\u7684\u5b9e\u73b0]<\/strong><\/h2>\n\n\n\n<p>\u4e0a\u9762\u7684\u5b9e\u73b0\u7b80\u5355\u53ef\u9760\uff0c\u552f\u4e00\u7684\u95ee\u9898\uff0c\u5c31\u662f\u5bf9\u8c61\u91ca\u653e\u5fc5\u9700\u7b49\u5f85\u5f02\u6b65\u64cd\u4f5c\u5b8c\u6210\u3002\u8fd9\u4e2a\u65f6\u95f4\u70b9\u662f\u4e0d\u53ef\u9760\u7684\uff0c\u8981\u66f4\u597d\u7684\u5b9e\u73b0\u53ef\u4ee5\u5c06\u5f02\u6b65\u8c03\u7528\u8fdb\u884c\u989d\u5916\u7684\u5904\u7406\uff0c\u5e76\u5c06\u5176\u4e0e\u5bf9\u8c61\u7684\u751f\u547d\u5468\u671f\u8fdb\u884c\u62e6\u622a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[\u57fa\u672c\u539f\u7406] \u6211\u4eec\u4f7f\u7528\u4e00\u4e2a\u5f15\u7528\u8ba1\u6570\u53ef\u4ee5\u5f88 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[8],"tags":[607,57],"class_list":["post-5766","post","type-post","status-publish","format-standard","hentry","category-delphi","tag-607","tag-57"],"views":2270,"_links":{"self":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/5766","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5766"}],"version-history":[{"count":2,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/5766\/revisions"}],"predecessor-version":[{"id":5768,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/5766\/revisions\/5768"}],"wp:attachment":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5766"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5766"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5766"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}