{"id":1715,"date":"2015-01-13T00:48:55","date_gmt":"2015-01-12T16:48:55","guid":{"rendered":"http:\/\/blog.qdac.cc\/?p=1715"},"modified":"2015-01-13T00:48:55","modified_gmt":"2015-01-12T16:48:55","slug":"qworker-%e6%9b%b4%e6%96%b0-%e6%96%b0%e5%a2%9e-enumjobstates-%e5%92%8c-peekjobstate-%e5%87%bd%e6%95%b0%e7%94%a8%e6%9d%a5%e8%8e%b7%e5%8f%96%e4%bd%9c%e4%b8%9a%e7%8a%b6%e6%80%81","status":"publish","type":"post","link":"https:\/\/blog.qdac.cc\/?p=1715","title":{"rendered":"QWorker \u66f4\u65b0 &#8211; \u65b0\u589e EnumJobStates \u548c PeekJobState \u51fd\u6570\u7528\u6765\u83b7\u53d6\u4f5c\u4e1a\u72b6\u6001"},"content":{"rendered":"<h4>\u3010\u66f4\u65b0\u5185\u5bb9\u3011<\/h4>\n<p>1\u3001EnumJobStates \u51fd\u6570\u7528\u4e8e\u679a\u4e3e\u6240\u6709\u4f5c\u4e1a\u7684\u72b6\u6001\uff0c\u5e76\u8fd4\u56de\u4e00\u4e2a\u4f5c\u4e1a\u72b6\u6001\u7684\u52a8\u6001\u6570\u7ec4\u3002<\/p>\n<pre class=\"lang:delphi decode:true \">\/\/\/ &lt;summary&gt;\u679a\u4e3e\u6240\u6709\u7684\u4f5c\u4e1a\u72b6\u6001&lt;\/summary&gt;\r\n\/\/\/ &lt;returns&gt;\u8fd4\u56de\u4f5c\u4e1a\u72b6\u6001\u5217\u8868&lt;\/summary&gt;\r\n\/\/\/ &lt;remarks&gt;\u5728\u79fb\u52a8\u5e73\u53f0\uff0c\u5982\u679c\u4f7f\u7528\u4e86\u533f\u540d\u51fd\u6570\u4f5c\u4e1a\u8fc7\u7a0b\uff0c\u5fc5\u9700\u8c03\u7528 ClearJobStates \u51fd\u6570\u6765\u6267\u884c\u6e05\u7406\u8fc7\u7a0b&lt;\/remarks&gt;\r\nfunction EnumJobStates: TQJobStateArray;<\/pre>\n<p>2\u3001PeekJobState \u51fd\u6570\u7528\u4e8e\u68c0\u67e5\u7279\u5b9a\u4f5c\u4e1a\u7684\u72b6\u6001\uff0c\u5982\u679c\u672a\u627e\u5230\u8be5\u4f5c\u4e1a\uff0c\u5219\u8fd4\u56deFalse\u3002<\/p>\n<pre class=\"lang:delphi decode:true \">\/\/\/ &lt;summary&gt;\u83b7\u53d6\u6307\u5b9a\u4f5c\u4e1a\u7684\u72b6\u6001&lt;\/summary&gt;\r\n\/\/\/ &lt;param name=\"AHandle\"&gt;\u4f5c\u4e1a\u5bf9\u8c61\u53e5\u67c4&lt;\/param&gt;\r\n\/\/\/ &lt;param name=\"AResult\"&gt;\u4f5c\u4e1a\u5bf9\u8c61\u72b6\u6001&lt;\/param&gt;\r\n\/\/\/ &lt;returns&gt;\u5982\u679c\u6307\u5b9a\u7684\u4f5c\u4e1a\u5b58\u5728\uff0c\u5219\u8fd4\u56deTrue\uff0c\u5426\u5219\uff0c\u8fd4\u56deFalse&lt;\/returns&gt;\r\n\/\/\/ &lt;remarks&gt;\r\n\/\/\/ 1.\u5bf9\u4e8e\u53ea\u6267\u884c\u4e00\u6b21\u7684\u4f5c\u4e1a\uff0c\u5728\u6267\u884c\u5b8c\u540e\u4e0d\u590d\u5b58\u5728\uff0c\u6240\u4ee5\u4e5f\u4f1a\u8fd4\u56defalse\r\n\/\/\/ 2.\u5728\u79fb\u52a8\u5e73\u53f0\uff0c\u5982\u679c\u4f7f\u7528\u4e86\u533f\u540d\u51fd\u6570\u4f5c\u4e1a\u8fc7\u7a0b\uff0c\u5fc5\u9700\u8c03\u7528 ClearJobState \u51fd\u6570\u6765\u6267\u884c\u6e05\u7406\u8fc7\u7a0b\uff0c\u4ee5\u907f\u514d\u5185\u5b58\u6cc4\u9732\u3002\r\n\/\/\/ &lt;\/remarks&gt;\r\nfunction PeekJobState(AHandle: IntPtr; var AResult: TQJobState): Boolean;<\/pre>\n<p>TQJobState \u7ed3\u6784\u7528\u4e8e\u8bb0\u5f55\u4f5c\u4e1a\u7684\u72b6\u6001\u4fe1\u606f\uff0c\u5176\u5b9a\u4e49\u5982\u4e0b\uff1a<\/p>\n<pre class=\"lang:delphi decode:true \">TQJobState = record\r\n    Handle: IntPtr; \/\/ \u4f5c\u4e1a\u5bf9\u8c61\u53e5\u67c4\r\n    Proc: TQJobMethod; \/\/ \u4f5c\u4e1a\u8fc7\u7a0b\r\n    Flags: Integer; \/\/ \u6807\u5fd7\u4f4d\r\n    IsRunning: Boolean; \/\/ \u662f\u5426\u5728\u8fd0\u884c\u4e2d\uff0c\u5982\u679c\u4e3aFalse\uff0c\u5219\u4f5c\u4e1a\u5904\u4e8e\u961f\u5217\u4e2d\r\n    Runs: Integer; \/\/ \u5df2\u7ecf\u8fd0\u884c\u7684\u6b21\u6570\r\n    EscapedTime: Int64; \/\/ \u5df2\u7ecf\u6267\u884c\u65f6\u95f4\r\n    PushTime: Int64; \/\/ \u5165\u961f\u65f6\u95f4\r\n    PopTime: Int64; \/\/ \u51fa\u961f\u65f6\u95f4\r\n    AvgTime: Int64; \/\/ \u5e73\u5747\u65f6\u95f4\r\n    TotalTime: Int64; \/\/ \u603b\u6267\u884c\u65f6\u95f4\r\n    MaxTime: Int64; \/\/ \u6700\u5927\u6267\u884c\u65f6\u95f4\r\n    MinTime: Int64; \/\/ \u6700\u5c0f\u6267\u884c\u65f6\u95f4\r\n    NextTime: Int64; \/\/ \u91cd\u590d\u4f5c\u4e1a\u7684\u4e0b\u6b21\u6267\u884c\u65f6\u95f4\r\n  end;<\/pre>\n<p><strong>\u6ce8\u610f\uff1a\u5728\u79fb\u52a8\u5e73\u53f0\u4f7f\u7528\u8fd9\u4e24\u4e2a\u51fd\u6570\u65f6\uff0c\u8981\u6ce8\u610f\u8c03\u7528\u76f8\u5e94\u7684\u65b9\u6cd5\u6e05\u7406\u7531\u4e8e\u533f\u540d\u51fd\u6570\u800c\u53ef\u80fd\u9020\u6210\u7684\u5f15\u7528\u95ee\u9898\u3002<\/strong><\/p>\n<p>\u5176\u793a\u4f8b\u4ee3\u7801\u53ef\u4ee5\u76f4\u63a5\u53c2\u8003QWorkerDemo\u91cc\u7684\u4e24\u4e2a\u4f8b\u5b50\uff0c\u6548\u679c\u5982\u4e0b\uff1a<\/p>\n<p><a href=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2015\/01\/EnumJobStats.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1716\" src=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2015\/01\/EnumJobStats.jpg\" alt=\"EnumJobStats\" width=\"727\" height=\"728\" srcset=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2015\/01\/EnumJobStats.jpg 727w, https:\/\/blog.qdac.cc\/wp-content\/uploads\/2015\/01\/EnumJobStats-150x150.jpg 150w, https:\/\/blog.qdac.cc\/wp-content\/uploads\/2015\/01\/EnumJobStats-300x300.jpg 300w\" sizes=\"auto, (max-width: 727px) 100vw, 727px\" \/><\/a><\/p>\n<h4>\u3010\u66f4\u65b0\u7ea7\u522b\u3011<\/h4>\n<p>\u53ef\u9009<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3010\u66f4\u65b0\u5185\u5bb9\u3011 1\u3001EnumJobStat [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","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":[69,8,9,6],"tags":[],"class_list":["post-1715","post","type-post","status-publish","format-standard","hentry","category-c-builder","category-delphi","category-qdac","category-qworker"],"views":2700,"_links":{"self":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/1715","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=1715"}],"version-history":[{"count":1,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/1715\/revisions"}],"predecessor-version":[{"id":1717,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/1715\/revisions\/1717"}],"wp:attachment":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1715"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1715"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}