{"id":2974,"date":"2023-07-14T17:38:40","date_gmt":"2023-07-14T09:38:40","guid":{"rendered":"https:\/\/xinchewhd.com.cn\/?p=2974"},"modified":"2023-07-14T17:44:07","modified_gmt":"2023-07-14T09:44:07","slug":"%e9%9d%a2%e8%af%95%e9%a2%98%e7%b3%bb%e5%88%97%ef%bc%9asynchronized-%e5%92%8c-reentrantlock-%e7%9a%84%e5%ae%9e%e7%8e%b0%e5%8e%9f%e7%90%86%e6%98%af%e4%bb%80%e4%b9%88%ef%bc%9f%e5%ae%83%e4%bb%ac%e6%9c%89","status":"publish","type":"post","link":"https:\/\/xinchewhd.com.cn\/index.php\/%e9%9d%a2%e8%af%95\/%e9%9d%a2%e8%af%95%e9%a2%98%e7%b3%bb%e5%88%97%ef%bc%9asynchronized-%e5%92%8c-reentrantlock-%e7%9a%84%e5%ae%9e%e7%8e%b0%e5%8e%9f%e7%90%86%e6%98%af%e4%bb%80%e4%b9%88%ef%bc%9f%e5%ae%83%e4%bb%ac%e6%9c%89\/","title":{"rendered":"\u9762\u8bd5\u9898\u7cfb\u5217\uff1aSynchronized \u548c ReentrantLock \u7684\u5b9e\u73b0\u539f\u7406\u662f\u4ec0\u4e48\uff1f\u5b83\u4eec\u6709\u4ec0\u4e48\u533a\u522b\uff1f"},"content":{"rendered":"<p style=\"margin-bottom: 0px;outline: 0px;max-width: 100%;white-space: normal;background-color: rgb(255, 255, 255);text-align: left;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><span style=\"outline: 0px;max-width: 100%;font-size: 12px;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\">\u4f5c\u8005\u5e73\u53f0\uff1a<\/span><span style=\"outline: 0px;max-width: 100%;font-size: 12px;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><\/span><\/p>\n<p style=\"margin-bottom: 0px;outline: 0px;max-width: 100%;white-space: normal;background-color: rgb(255, 255, 255);text-align: left;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><span style=\"outline: 0px;max-width: 100%;font-size: 12px;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\">| CSDN\uff1ahttps:\/\/blog.csdn.net\/qq_41153943\uff08ID\uff1a\u6c5f\u590f\u3001\uff09<\/span><br style=\"outline: 0px;max-width: 100%;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><\/p>\n<p style=\"margin-bottom: 0px;outline: 0px;max-width: 100%;white-space: normal;background-color: rgb(255, 255, 255);text-align: left;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><span style=\"outline: 0px;max-width: 100%;font-size: 12px;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\">| \u6398\u91d1\uff1ahttps:\/\/juejin.cn\/user\/651387938290686\uff08<span style=\"outline: 0px;max-width: 100%;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\">ID\uff1a<\/span><\/span><span style=\"outline: 0px;max-width: 100%;font-size: 12px;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\">jiangxia_1024<\/span><span style=\"outline: 0px;max-width: 100%;font-size: 16px;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\">\uff09<\/span><\/p>\n<p style=\"margin-bottom: 0px;outline: 0px;max-width: 100%;white-space: normal;background-color: rgb(255, 255, 255);text-align: left;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><span style=\"outline: 0px;max-width: 100%;font-size: 12px;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\">| \u77e5\u4e4e\uff1ahttps:\/\/www.zhihu.com\/p<\/span><span style=\"outline: 0px;max-width: 100%;font-size: 12px;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\">eople\/1024-paper-96\uff08<span style=\"outline: 0px;max-width: 100%;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\">ID\uff1a<\/span>\u6c5f\u590f\uff09<\/span><\/p>\n<p style=\"margin-bottom: 0px;outline: 0px;max-width: 100%;white-space: normal;background-color: rgb(255, 255, 255);text-align: left;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><span style=\"outline: 0px;max-width: 100%;font-size: 12px;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><span style=\"outline: 0px;max-width: 100%;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\">| GitHub\uff1ahttps:\/\/github.com\/JiangXia-1024?tab=repositories<\/span><\/span><\/p>\n<p style=\"margin-bottom: 0px;outline: 0px;max-width: 100%;white-space: normal;background-color: rgb(255, 255, 255);text-align: left;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><span style=\"outline: 0px;max-width: 100%;font-size: 12px;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><span style=\"outline: 0px;max-width: 100%;font-family: -apple-system-font, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><span style=\"outline: 0px;max-width: 100%;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\">|&nbsp;\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a1024\u7b14\u8bb0<\/span><span style=\"outline: 0px;max-width: 100%;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><\/span><\/span><\/span><\/p>\n<blockquote class=\"js_blockquote_wrap\" data-type=\"2\" data-url=\"\" data-author-name=\"\" data-content-utf8-length=\"18\" data-source-title=\"\" style=\"outline: 0px;max-width: 100%;white-space: normal;background-color: rgb(255, 255, 255);visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\">\n<section class=\"js_blockquote_digest\" style=\"outline: 0px;max-width: 100%;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\">\n<section style=\"outline: 0px;max-width: 100%;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\">\n   \u672c\u6587\u4e00\u51711784\u5b57\uff0c\u9884\u8ba1\u9605\u8bfb11\u5206\u949f<br \/>\n  <\/section>\n<\/section>\n<\/blockquote>\n<section>\n <qqmusic class=\"js_editor_qqmusic qqmusic_iframe res_iframe js_uneditable custom_select_card\" musicid=\"393960844\" mid=\"001YzonG3t1Amz\" albumurl=\"https:\/\/y.gtimg.cn\/music\/photo_new\/T002R68x68M000001qbyMM2byl8Q.jpg\" audiourl=\"http:\/\/isure6.stream.qqmusic.qq.com\/C2000015lxlx4FJv8f.m4a?guid=2000000052&amp;vkey=ABFE2B35987398A5EE202E0162B03DE1D106B0C4FD466D6F36FF84999BCD7FB46BF404CF50826DDC110AE762B4742FD45C89F0D89CEB8497&amp;uin=0&amp;fromtag=20052\" music_name=\"\u843d\u5728\u751f\u547d\u91cc\u7684\u5149\" singer=\"\u6797\u4fca\u6770&nbsp;-&nbsp;JJ\u7684\u5496\u5561\u8c03\u8c03,&nbsp;Vol.&nbsp;2\" play_length=\"209\" src=\"\/mp\/readtemplate?t=app_editor\/music&amp;singer=%E6%9E%97%E4%BF%8A%E6%9D%B0%20-%20JJ%E7%9A%84%E5%92%96%E5%95%A1%E8%B0%83%E8%B0%83%2C%20Vol.%202&amp;music_name=%E8%90%BD%E5%9C%A8%E7%94%9F%E5%91%BD%E9%87%8C%E7%9A%84%E5%85%89&amp;albumurl=https%3A%2F%2Fy.gtimg.cn%2Fmusic%2Fphoto_new%2FT002R68x68M000001qbyMM2byl8Q.jpg&amp;musictype=1\" musictype=\"1\" otherid=\"001YzonG3t1Amz\" albumid=\"001qbyMM2byl8Q\" jumpurlkey=\"\" data-pluginname=\"insertaudio\"><\/qqmusic><br \/>\n<\/section>\n<section style=\"outline: 0px;max-width: 100%;color: rgba(0, 0, 0, 0.9);font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);visibility: visible;margin-bottom: 16px;margin-top: 24px;box-sizing: border-box !important;overflow-wrap: break-word !important;\">\n <span style=\"font-weight: bolder;font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;background-color: rgb(255, 255, 255);color: rgb(0, 128, 255);text-align: left;outline: 0px;max-width: 100%;font-size: 14px;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\">1\u3001\u4ec0\u4e48\u662fSynchronized\u548cReentrantLock<\/span><br \/>\n<\/section>\n<p data-first-child=\"\" data-pid=\"LIc7OGrD\" style=\"outline: 0px;max-width: 100%;color: rgba(0, 0, 0, 0.9);font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><span style=\"font-size: 14px;letter-spacing: 0.544px;\">Synchronized\u548cReentrantLock\u90fd\u662fJava\u4e2d\u5b9e\u73b0\u7ebf\u7a0b\u540c\u6b65\u7684\u673a\u5236\uff0c\u5b83\u4eec\u7684\u76ee\u7684\u90fd\u662f\u4e3a\u4e86\u4fdd\u8bc1\u591a\u4e2a\u7ebf\u7a0b\u8bbf\u95ee\u5171\u4eab\u8d44\u6e90\u65f6\u7684\u4e92\u65a5\u6027\u548c\u53ef\u89c1\u6027\u3002<\/span><\/p>\n<p data-pid=\"fCEd2QBp\" style=\"outline: 0px;max-width: 100%;color: rgba(0, 0, 0, 0.9);font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><span style=\"font-size: 14px;letter-spacing: 0.544px;\">Synchronized \u7684\u5b9e\u73b0\u539f\u7406\u662f\u57fa\u4e8e Jav<\/span><span style=\"font-size: 14px;letter-spacing: 0.544px;\">a \u4e2d\u7684\u5185\u7f6e\u76d1\u89c6\u5668\u9501\uff08<\/span><span style=\"font-size: 14px;letter-spacing: 0.544px;\">Intrinsic Lock\uff09\u6216\u79f0\u4f5c\u5bf9\u8c61\u9501\uff08Object Lock\uff09\uff0c\u6bcf\u4e2a Java \u5bf9\u8c61\u90fd\u6709\u4e00\u4e2a\u4e0e\u4e4b\u5173\u8054\u7684\u9501\u3002<\/span><\/p>\n<p data-pid=\"UhJZzROU\" style=\"outline: 0px;max-width: 100%;color: rgba(0, 0, 0, 0.9);font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><span style=\"font-size: 14px;letter-spacing: 0.544px;\">\u5f53\u4e00\u4e2a synchronized \u4ee3\u7801\u5757\u6267\u884c\u65f6\uff0c\u4f1a\u9996\u5148\u5c1d\u8bd5\u83b7\u5f97\u5185\u7f6e\u76d1\u89c6\u5668\u9501\u3002\u5982\u679c\u9501\u5df2\u7ecf\u88ab\u5176\u4ed6\u7ebf\u7a0b\u6301\u6709\uff0c\u5219\u5f53\u524d\u7ebf\u7a0b\u5c06\u8fdb\u5165\u963b\u585e\u72b6\u6001\uff0c\u76f4\u5230\u8be5\u9501\u88ab\u91ca\u653e\u4e3a\u6b62\uff1b\u5982\u679c\u9501\u672a\u88ab\u6301\u6709\uff0c\u5219\u5f53\u524d\u7ebf\u7a0b\u83b7\u5f97\u8be5\u9501\u3002\u5728 synchronized \u5757\u7ed3\u675f\u65f6\uff0c\u4f1a\u81ea\u52a8\u91ca\u653e\u9501\u3002<\/span><\/p>\n<p data-pid=\"3Lvy0DA_\" style=\"outline: 0px;max-width: 100%;color: rgba(0, 0, 0, 0.9);font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><span style=\"font-size: 14px;letter-spacing: 0.544px;\">ReentrantLock \u5219\u662f\u901a\u8fc7 java.util.concurrent.locks.ReentrantLock \u7c7b\u6765\u5b9e\u73b0\u7684\uff0c\u5b83\u5229\u7528\u4e86 Java\u4e2d\u7684AQS(AbstractQueuedSynchronizer) \u6765\u5b9e\u73b0\u7ebf\u7a0b\u7684\u540c\u6b65\uff0c\u5b83\u5141\u8bb8\u91cd\u5165\u7279\u6027\uff0c\u5373\u540c\u4e00\u7ebf\u7a0b\u53ef\u4ee5\u5bf9\u5df2\u7ecf\u83b7\u53d6\u5230\u7684\u9501\u518d\u6b21\u8fdb\u884c\u8bf7\u6c42\uff0c\u5982\u679c\u4e0d\u652f\u6301\u91cd\u5165\uff0c\u5219\u4f1ajava.lang.IllegalMonitorStateException\u5f02\u5e38\u3002<\/span><\/p>\n<h2 data-block=\"true\" data-editor=\"57jgm\" data-offset-key=\"5oqs6-0-0\" style=\"outline: 0px;max-width: 100%;color: rgba(0, 0, 0, 0.9);font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);visibility: visible;margin-bottom: 16px;box-sizing: border-box !important;overflow-wrap: break-word !important;\">\n<p style=\"outline: 0px;max-width: 100%;color: rgba(0, 0, 0, 0.9);font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);visibility: visible;margin-bottom: 16px;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><span style=\"font-weight: bolder;font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;background-color: rgb(255, 255, 255);color: rgb(0, 128, 255);text-align: left;outline: 0px;max-width: 100%;font-size: 14px;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\">2\u3001ReentrantLock \u548c synchronized\u7684\u533a\u522b<\/span><\/p>\n<\/h2>\n<p data-pid=\"wx-9h5Bo\" style=\"outline: 0px;max-width: 100%;color: rgba(0, 0, 0, 0.9);font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><span style=\"font-size: 14px;letter-spacing: 0.544px;\">\u4e00\u822c\u6765\u8bf4ReentrantLock \u548c synchronized \u76f8\u6bd4\uff0c\u5177\u6709\u4ee5\u4e0b\u4f18\u70b9\uff1a<\/span><\/p>\n<p data-pid=\"MbFjPX11\" style=\"outline: 0px;max-width: 100%;color: rgba(0, 0, 0, 0.9);font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><span style=\"font-size: 14px;letter-spacing: 0.544px;\">1. \u53ef\u4ee5\u5b9e\u73b0\u516c\u5e73\u9501\u548c\u975e\u516c\u5e73\u9501\uff1aReentrantLock \u7684\u6784\u9020\u51fd\u6570\u4e2d\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5e03\u5c14\u7c7b\u578b\u7684\u53c2\u6570 fair\uff0c\u53ef\u4ee5\u9009\u62e9\u521b\u5efa\u516c\u5e73\u9501\u8fd8\u662f\u975e\u516c\u5e73\u9501\u3002\u800c synchronized \u603b\u662f\u975e\u516c\u5e73\u9501\u3002<\/span><\/p>\n<p data-pid=\"R5GAVpks\" style=\"outline: 0px;max-width: 100%;color: rgba(0, 0, 0, 0.9);font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><span style=\"font-size: 14px;letter-spacing: 0.544px;\">2. \u652f\u6301\u591a\u4e2a Condition \u5bf9\u8c61\uff1aReentrantLock \u4e2d\u7684 Condition \u7c7b\u53ef\u4ee5\u521b\u5efa\u591a\u4e2a\u7b49\u5f85\u961f\u5217\uff0c\u4ee5\u4fbf\u66f4\u7ec6\u7c92\u5ea6\u5730\u63a7\u5236\u7ebf\u7a0b\u7684\u5524\u9192\u3002<\/span><\/p>\n<p data-pid=\"HhKBP7s-\" style=\"outline: 0px;max-width: 100%;color: rgba(0, 0, 0, 0.9);font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><span style=\"font-size: 14px;letter-spacing: 0.544px;\">3. \u652f\u6301\u4e2d\u65ad\u7b49\u5f85\u9501\u7684\u7ebf\u7a0b\uff1a\u901a\u8fc7 ReentrantLock \u7684 lockInterruptibly \u65b9\u6cd5\uff0c\u53ef\u4ee5\u5b9e\u73b0\u5bf9\u7b49\u5f85\u9501\u7684\u7ebf\u7a0b\u8fdb\u884c\u4e2d\u65ad\u64cd\u4f5c\u3002synchronized \u5219\u65e0\u6cd5\u4e2d\u65ad\u7b49\u5f85\u9501\u7684\u7ebf\u7a0b\u3002<\/span><\/p>\n<p data-pid=\"QAGsICwC\" style=\"outline: 0px;max-width: 100%;color: rgba(0, 0, 0, 0.9);font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><span style=\"font-size: 14px;letter-spacing: 0.544px;\">4. \u63d0\u4f9b\u4e86\u4e00\u4e9b\u9ad8\u7ea7\u529f\u80fd\uff1a\u5982 tryLock() \u5c1d\u8bd5\u83b7\u5f97\u9501\u4f46\u4e0d\u963b\u585e\uff1blockInterruptibly() \u80fd\u591f\u54cd\u5e94\u7ebf\u7a0b\u7684\u4e2d\u65ad\u8bf7\u6c42\u3002<\/span><\/p>\n<p data-pid=\"nE-FHK5b\" style=\"outline: 0px;max-width: 100%;color: rgba(0, 0, 0, 0.9);font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><span style=\"font-size: 14px;letter-spacing: 0.544px;\">\u5728\u4f7f\u7528 ReentrantLock \u65f6\uff0c\u9700\u8981\u624b\u52a8\u91ca\u653e\u9501\uff0c\u5426\u5219\u53ef\u80fd\u4f1a\u5bfc\u81f4\u6b7b\u9501\u7b49\u95ee\u9898\u3002<\/span><\/p>\n<p data-pid=\"YnuNfeVa\" style=\"outline: 0px;max-width: 100%;color: rgba(0, 0, 0, 0.9);font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><span style=\"font-size: 14px;letter-spacing: 0.544px;\">\u603b\u7ed3\u4e0b\u6765\uff0csynchronized \u548c ReentrantLock \u90fd\u53ef\u4ee5\u5b9e\u73b0\u7ebf\u7a0b\u540c\u6b65\uff0c\u4f46\u5728\u7279\u5b9a\u7684\u573a\u666f\u4e0b\u6709\u7740\u5404\u81ea\u7684\u4f18\u7f3a\u70b9\u3002\u901a\u5e38\u60c5\u51b5\u4e0b\uff0csynchronized \u66f4\u52a0\u7b80\u5355\u6613\u7528\uff0c\u800c ReentrantLock \u5728\u67d0\u4e9b\u590d\u6742\u573a\u666f\u4e0b\u80fd\u591f\u63d0\u4f9b\u66f4\u4e30\u5bcc\u7684\u529f\u80fd\u3002<\/span><span style=\"font-size: 14px;letter-spacing: 0.544px;\"><\/span><\/p>\n<h2 data-block=\"true\" data-editor=\"57jgm\" data-offset-key=\"e2hdh-0-0\" style=\"outline: 0px;max-width: 100%;color: rgba(0, 0, 0, 0.9);font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);visibility: visible;margin-bottom: 16px;box-sizing: border-box !important;overflow-wrap: break-word !important;\">\n<p style=\"outline: 0px;max-width: 100%;color: rgba(0, 0, 0, 0.9);font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);visibility: visible;margin-bottom: 16px;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><span style=\"font-weight: bolder;font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;background-color: rgb(255, 255, 255);color: rgb(0, 128, 255);text-align: left;outline: 0px;max-width: 100%;font-size: 14px;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\">3\u3001\u4ee3\u7801\u6f14\u793a<\/span><span style=\"font-size: 14px;letter-spacing: 0.544px;\"><\/span><\/p>\n<\/h2>\n<p data-pid=\"ujEuT63N\" style=\"outline: 0px;max-width: 100%;color: rgba(0, 0, 0, 0.9);font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><span style=\"font-size: 14px;letter-spacing: 0.544px;\">\u63a5\u4e0b\u6765\u4ee3\u7801\u5206\u522b\u6f14\u793aSynchronized\u548cReentrantLock\u7684\u4f7f\u7528\uff1a<\/span><\/p>\n<p data-pid=\"9rCr8beg\" style=\"outline: 0px;max-width: 100%;color: rgba(0, 0, 0, 0.9);font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><span style=\"font-size: 14px;letter-spacing: 0.544px;\">\u4f7f\u7528 synchronized \u5b9e\u73b0\u7ebf\u7a0b\u540c\u6b65\u7684\u793a\u4f8b\u4ee3\u7801\uff1a<\/span><\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"java\"><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__class\"><span class=\"code-snippet__keyword\">class<\/span> <span class=\"code-snippet__title\">SynchronizedDemo<\/span> <\/span>{<\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__keyword\">private<\/span> <span class=\"code-snippet__keyword\">int<\/span> count = <span class=\"code-snippet__number\">0<\/span>;<\/span><\/code><code><span class=\"code-snippet_outer\"><br><\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__function\"><span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__keyword\">synchronized<\/span> <span class=\"code-snippet__keyword\">void<\/span> <span class=\"code-snippet__title\">increment<\/span><span class=\"code-snippet__params\">()<\/span> <\/span>{<\/span><\/code><code><span class=\"code-snippet_outer\">        <span class=\"code-snippet__comment\">\/\/ \u5bf9\u4e34\u754c\u533a\u8fdb\u884c\u52a0\u9501\u4fdd\u62a4<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">        count++;<\/span><\/code><code><span class=\"code-snippet_outer\">    }<\/span><\/code><code><span class=\"code-snippet_outer\"><br><\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__function\"><span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__keyword\">static<\/span> <span class=\"code-snippet__keyword\">void<\/span> <span class=\"code-snippet__title\">main<\/span><span class=\"code-snippet__params\">(String[] args)<\/span> <span class=\"code-snippet__keyword\">throws<\/span> Exception <\/span>{<\/span><\/code><code><span class=\"code-snippet_outer\">        <span class=\"code-snippet__keyword\">final<\/span> SynchronizedDemo demo = <span class=\"code-snippet__keyword\">new<\/span> SynchronizedDemo();<\/span><\/code><code><span class=\"code-snippet_outer\"><br><\/span><\/code><code><span class=\"code-snippet_outer\">        <span class=\"code-snippet__comment\">\/\/ \u521b\u5efa\u4e24\u4e2a\u7ebf\u7a0b\u5e76\u542f\u52a8<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">        Thread t1 = <span class=\"code-snippet__keyword\">new<\/span> Thread(<span class=\"code-snippet__keyword\">new<\/span> Runnable() {<\/span><\/code><code><span class=\"code-snippet_outer\">            <span class=\"code-snippet__meta\">@Override<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">            <span class=\"code-snippet__function\"><span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__keyword\">void<\/span> <span class=\"code-snippet__title\">run<\/span><span class=\"code-snippet__params\">()<\/span> <\/span>{<\/span><\/code><code><span class=\"code-snippet_outer\">                <span class=\"code-snippet__keyword\">for<\/span> (<span class=\"code-snippet__keyword\">int<\/span> i = <span class=\"code-snippet__number\">0<\/span>; i &lt; <span class=\"code-snippet__number\">100000<\/span>; i++) {<\/span><\/code><code><span class=\"code-snippet_outer\">                    demo.increment();<\/span><\/code><code><span class=\"code-snippet_outer\">                }<\/span><\/code><code><span class=\"code-snippet_outer\">            }<\/span><\/code><code><span class=\"code-snippet_outer\">        });<\/span><\/code><code><span class=\"code-snippet_outer\">        t1.start();<\/span><\/code><code><span class=\"code-snippet_outer\"><br><\/span><\/code><code><span class=\"code-snippet_outer\">        Thread t2 = <span class=\"code-snippet__keyword\">new<\/span> Thread(<span class=\"code-snippet__keyword\">new<\/span> Runnable() {<\/span><\/code><code><span class=\"code-snippet_outer\">            <span class=\"code-snippet__meta\">@Override<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">            <span class=\"code-snippet__function\"><span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__keyword\">void<\/span> <span class=\"code-snippet__title\">run<\/span><span class=\"code-snippet__params\">()<\/span> <\/span>{<\/span><\/code><code><span class=\"code-snippet_outer\">                <span class=\"code-snippet__keyword\">for<\/span> (<span class=\"code-snippet__keyword\">int<\/span> i = <span class=\"code-snippet__number\">0<\/span>; i &lt; <span class=\"code-snippet__number\">100000<\/span>; i++) {<\/span><\/code><code><span class=\"code-snippet_outer\">                    demo.increment();<\/span><\/code><code><span class=\"code-snippet_outer\">                }<\/span><\/code><code><span class=\"code-snippet_outer\">            }<\/span><\/code><code><span class=\"code-snippet_outer\">        });<\/span><\/code><code><span class=\"code-snippet_outer\">        t2.start();<\/span><\/code><code><span class=\"code-snippet_outer\"><br><\/span><\/code><code><span class=\"code-snippet_outer\">        <span class=\"code-snippet__comment\">\/\/ \u7b49\u5f85\u4e24\u4e2a\u7ebf\u7a0b\u6267\u884c\u5b8c\u6bd5<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">        t1.join();<\/span><\/code><code><span class=\"code-snippet_outer\">        t2.join();<\/span><\/code><code><span class=\"code-snippet_outer\"><br><\/span><\/code><code><span class=\"code-snippet_outer\">        <span class=\"code-snippet__comment\">\/\/ \u8f93\u51fa\u7ed3\u679c<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">        System.out.println(<span class=\"code-snippet__string\">\"count = \"<\/span> + demo.count);<\/span><\/code><code><span class=\"code-snippet_outer\">    }<\/span><\/code><code><span class=\"code-snippet_outer\">}<\/span><\/code><\/pre>\n<\/section>\n<p data-pid=\"__SqHsUc\" style=\"outline: 0px;max-width: 100%;color: rgba(0, 0, 0, 0.9);font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><span style=\"font-size: 14px;letter-spacing: 0.544px;\">\u5728 increment \u65b9\u6cd5\u4e0a\u6dfb\u52a0 synchronized \u5173\u952e\u5b57\uff0c\u53ef\u4ee5\u5b9e\u73b0\u5bf9\u4e34\u754c\u533a\u4ee3\u7801\u5757\u7684\u4e92\u65a5\u8bbf\u95ee\uff0c\u4ece\u800c\u80fd\u591f\u786e\u4fdd\u591a\u4e2a\u7ebf\u7a0b\u5728\u540c\u65f6\u5bf9\u5171\u4eab\u53d8\u91cf count \u8fdb\u884c\u4fee\u6539\u65f6\u4e0d\u4f1a\u53d1\u751f\u51b2\u7a81\u3002<\/span><\/p>\n<p data-pid=\"e-cyPfxI\" style=\"outline: 0px;max-width: 100%;color: rgba(0, 0, 0, 0.9);font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><span style=\"font-size: 14px;letter-spacing: 0.544px;\">\u4f7f\u7528 ReentrantLock \u5b9e\u73b0\u7ebf\u7a0b\u540c\u6b65\u7684\u793a\u4f8b\u4ee3\u7801\u5982\u4e0b\uff1a<\/span><\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"cs\"><code><span class=\"code-snippet_outer\">import java.util.concurrent.locks.Lock;<\/span><\/code><code><span class=\"code-snippet_outer\">import java.util.concurrent.locks.ReentrantLock;<\/span><\/code><code><span class=\"code-snippet_outer\"><br><\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__keyword\">class<\/span> <span class=\"code-snippet__title\">ReentrantLockDemo<\/span> {<\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__keyword\">private<\/span> <span class=\"code-snippet__keyword\">int<\/span> count = <span class=\"code-snippet__number\">0<\/span>;<\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__keyword\">private<\/span> Lock <span class=\"code-snippet__keyword\">lock<\/span> = <span class=\"code-snippet__keyword\">new<\/span> ReentrantLock();<\/span><\/code><code><span class=\"code-snippet_outer\"><br><\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__function\"><span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__keyword\">void<\/span> <span class=\"code-snippet__title\">increment<\/span>(<span class=\"code-snippet__params\"><\/span>)<\/span> {<\/span><\/code><code><span class=\"code-snippet_outer\">        <span class=\"code-snippet__comment\">\/\/ \u4e0a\u9501<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">        <span class=\"code-snippet__keyword\">lock<\/span>.<span class=\"code-snippet__keyword\">lock<\/span>();<\/span><\/code><code><span class=\"code-snippet_outer\">        <span class=\"code-snippet__keyword\">try<\/span> {<\/span><\/code><code><span class=\"code-snippet_outer\">            count++;<\/span><\/code><code><span class=\"code-snippet_outer\">        } <span class=\"code-snippet__keyword\">finally<\/span> {<\/span><\/code><code><span class=\"code-snippet_outer\">            <span class=\"code-snippet__comment\">\/\/ \u91ca\u653e\u9501<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">            <span class=\"code-snippet__keyword\">lock<\/span>.unlock();<\/span><\/code><code><span class=\"code-snippet_outer\">        }<\/span><\/code><code><span class=\"code-snippet_outer\">    }<\/span><\/code><code><span class=\"code-snippet_outer\"><br><\/span><\/code><code><span class=\"code-snippet_outer\">    <span class=\"code-snippet__function\"><span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__keyword\">static<\/span> <span class=\"code-snippet__keyword\">void<\/span> <span class=\"code-snippet__title\">main<\/span>(<span class=\"code-snippet__params\">String[] args<\/span>) throws Exception<\/span> {<\/span><\/code><code><span class=\"code-snippet_outer\">        final ReentrantLockDemo demo = <span class=\"code-snippet__keyword\">new<\/span> ReentrantLockDemo();<\/span><\/code><code><span class=\"code-snippet_outer\"><br><\/span><\/code><code><span class=\"code-snippet_outer\">        <span class=\"code-snippet__comment\">\/\/ \u521b\u5efa\u4e24\u4e2a\u7ebf\u7a0b\u5e76\u542f\u52a8<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">        Thread t1 = <span class=\"code-snippet__keyword\">new<\/span> Thread(<span class=\"code-snippet__keyword\">new<\/span> Runnable() {<\/span><\/code><code><span class=\"code-snippet_outer\">            @<span class=\"code-snippet__function\">Override<\/span><\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet_outer\">            <span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__keyword\">void<\/span> <span class=\"code-snippet__title\">run<\/span>(<span class=\"code-snippet__params\"><\/span>)<\/span> {<\/span><\/code><code><span class=\"code-snippet_outer\">                <span class=\"code-snippet__keyword\">for<\/span> (<span class=\"code-snippet__keyword\">int<\/span> i = <span class=\"code-snippet__number\">0<\/span>; i &lt; <span class=\"code-snippet__number\">100000<\/span>; i++) {<\/span><\/code><code><span class=\"code-snippet_outer\">                    demo.increment();<\/span><\/code><code><span class=\"code-snippet_outer\">                }<\/span><\/code><code><span class=\"code-snippet_outer\">            }<\/span><\/code><code><span class=\"code-snippet_outer\">        });<\/span><\/code><code><span class=\"code-snippet_outer\">        t1.start();<\/span><\/code><code><span class=\"code-snippet_outer\"><br><\/span><\/code><code><span class=\"code-snippet_outer\">        Thread t2 = <span class=\"code-snippet__keyword\">new<\/span> Thread(<span class=\"code-snippet__keyword\">new<\/span> Runnable() {<\/span><\/code><code><span class=\"code-snippet_outer\">            @<span class=\"code-snippet__function\">Override<\/span><\/span><\/code><code><span class=\"code-snippet_outer\"><span class=\"code-snippet_outer\">            <span class=\"code-snippet__keyword\">public<\/span> <span class=\"code-snippet__keyword\">void<\/span> <span class=\"code-snippet__title\">run<\/span>(<span class=\"code-snippet__params\"><\/span>)<\/span> {<\/span><\/code><code><span class=\"code-snippet_outer\">                <span class=\"code-snippet__keyword\">for<\/span> (<span class=\"code-snippet__keyword\">int<\/span> i = <span class=\"code-snippet__number\">0<\/span>; i &lt; <span class=\"code-snippet__number\">100000<\/span>; i++) {<\/span><\/code><code><span class=\"code-snippet_outer\">                    demo.increment();<\/span><\/code><code><span class=\"code-snippet_outer\">                }<\/span><\/code><code><span class=\"code-snippet_outer\">            }<\/span><\/code><code><span class=\"code-snippet_outer\">        });<\/span><\/code><code><span class=\"code-snippet_outer\">        t2.start();<\/span><\/code><code><span class=\"code-snippet_outer\"><br><\/span><\/code><code><span class=\"code-snippet_outer\">        <span class=\"code-snippet__comment\">\/\/ \u7b49\u5f85\u4e24\u4e2a\u7ebf\u7a0b\u6267\u884c\u5b8c\u6bd5<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">        t1.<span class=\"code-snippet__keyword\">join<\/span>();<\/span><\/code><code><span class=\"code-snippet_outer\">        t2.<span class=\"code-snippet__keyword\">join<\/span>();<\/span><\/code><code><span class=\"code-snippet_outer\"><br><\/span><\/code><code><span class=\"code-snippet_outer\">        <span class=\"code-snippet__comment\">\/\/ \u8f93\u51fa\u7ed3\u679c<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">        System.<span class=\"code-snippet__keyword\">out<\/span>.println(<span class=\"code-snippet__string\">\"count = \"<\/span> + demo.count);<\/span><\/code><code><span class=\"code-snippet_outer\">    }<\/span><\/code><code><span class=\"code-snippet_outer\">}<\/span><\/code><\/pre>\n<\/section>\n<section style=\"outline: 0px;max-width: 100%;color: rgba(0, 0, 0, 0.9);font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);visibility: visible;margin-top: 24px;box-sizing: border-box !important;overflow-wrap: break-word !important;\">\n <span style=\"font-size: 14px;letter-spacing: 0.544px;\">\u8fd9\u6bb5\u4ee3\u7801\u548c\u4f7f\u7528 synchronized \u7684\u793a\u4f8b\u4ee3\u7801\u7c7b\u4f3c\uff0c\u4e0d\u540c\u4e4b\u5904\u5728\u4e8e\u5b83\u4f7f\u7528\u4e86 ReentrantLock \u7c7b\u6765\u5b9e\u73b0\u4e92\u65a5\u8bbf\u95ee\u3002\u9996\u5148\u521b\u5efa\u4e86\u4e00\u4e2a ReentrantLock \u5bf9\u8c61\uff0c\u5728 increment\u65b9\u6cd5\u4e2d\u8fdb\u884c\u52a0\u9501\u548c\u89e3\u9501\u64cd\u4f5c\u3002<\/span><br \/>\n<\/section>\n<p data-pid=\"57Szgy6F\" style=\"outline: 0px;max-width: 100%;color: rgba(0, 0, 0, 0.9);font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><span style=\"font-size: 14px;letter-spacing: 0.544px;\">\u5728\u4f7f\u7528 ReentrantLock \u65f6\uff0c\u6700\u597d\u5728 finally \u5757\u4e2d\u8fdb\u884c\u89e3\u9501\u64cd\u4f5c\uff0c\u786e\u4fdd\u7ebf\u7a0b\u4e0d\u4f1a\u56e0\u4e3a\u88ab\u9501\u6b7b\u800c\u65e0\u6cd5\u91ca\u653e\u9501\u3002\u53e6\u5916\uff0c\u5728\u58f0\u660e ReentrantLock \u53d8\u91cf\u65f6\uff0c\u5c3d\u91cf\u5c06\u5176\u8bbe\u7f6e\u6210 private\uff0c\u5e76\u7ed9\u51fa\u76f8\u5e94\u7684 getter\/setter \u65b9\u6cd5\uff0c\u8fd9\u6837\u80fd\u591f\u9632\u6b62\u76f4\u63a5\u4fee\u6539\u5185\u90e8\u72b6\u6001\u3002<\/span><\/p>\n<p data-pid=\"LYLR2Kbn\" style=\"outline: 0px;max-width: 100%;color: rgba(0, 0, 0, 0.9);font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><span style=\"font-weight: bolder;font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;background-color: rgb(255, 255, 255);color: rgb(0, 128, 255);text-align: left;outline: 0px;max-width: 100%;font-size: 14px;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\">4\u3001<\/span><span style=\"font-size: 14px;letter-spacing: 0.544px;\"><span style=\"outline: 0px;font-weight: bolder;max-width: 100%;font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;background-color: rgb(255, 255, 255);color: rgb(0, 128, 255);text-align: left;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><span style=\"outline: 0px;max-width: 100%;font-size: 14px;visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\">\u603b\u7ed3<\/span><\/span><\/span><\/p>\n<p data-pid=\"LYLR2Kbn\" style=\"outline: 0px;max-width: 100%;color: rgba(0, 0, 0, 0.9);font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><span style=\"font-size: 14px;letter-spacing: 0.544px;\">Synchronized \u548c ReentrantLock \u90fd\u53ef\u4ee5\u5b9e\u73b0<\/span><span style=\"font-size: 14px;letter-spacing: 0.544px;\">\u7ebf\u7a0b\u540c\u6b65\uff0c\u4f46\u5728\u7279\u5b9a\u7684\u573a\u666f\u4e0b\u6709\u7740\u5404\u81ea\u7684\u4f18\u7f3a\u70b9\u3002\u901a\u5e38\u60c5\u51b5\u4e0b\uff0csynchronized \u66f4\u52a0\u7b80\u5355\u6613\u7528\uff0c\u800c Reentr<\/span><span style=\"font-size: 14px;letter-spacing: 0.544px;\">antLock \u5728\u67d0\u4e9b\u590d\u6742\u573a\u666f\u4e0b\u80fd\u591f\u63d0\u4f9b\u66f4\u4e30\u5bcc\u7684\u529f\u80fd\u3002<\/span><span style=\"font-size: 14px;letter-spacing: 0.544px;\"><span style=\"font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 14px;letter-spacing: 0.544px;background-color: rgb(255, 255, 255);\"><\/span><\/span><\/p>\n<p data-pid=\"LYLR2Kbn\" style=\"outline: 0px;max-width: 100%;color: rgba(0, 0, 0, 0.9);font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><span style=\"font-size: 14px;letter-spacing: 0.544px;\">\u6700\u540e\u611f\u8c22\u5927\u5bb6\u7684\u5173\u6ce8\uff01<\/span><\/p>\n<p style=\"text-align: center;margin-bottom: 0px;\"><span style=\"color: rgb(214, 214, 214);font-family: \u5fae\u8f6f\u96c5\u9ed1;font-size: 14px;letter-spacing: 2px;text-align: center;word-spacing: 2px;background-color: rgb(255, 255, 255);\">-END-<\/span><\/p>\n<section class=\"mp_profile_iframe_wrp\">\n <mp-common-profile class=\"js_uneditable custom_select_card mp_profile_iframe\" data-pluginname=\"mpprofile\" data-weui-theme=\"light\" data-id=\"MzUyNTgzNDc3MQ==\" data-headimg=\"http:\/\/mmbiz.qpic.cn\/mmbiz_png\/5NVISkvytgCPNzDZqib1NzmeMHDUcXGltcylm8eIslxDRiah4EX9Ze4alkic7RwFuLd70CciaRTdjGBn96AiaIvejxQ\/0?wx_fmt=png\" data-nickname=\"1024\u7b14\u8bb0\" data-alias=\"Jang_1024\" data-signature=\"\u52aa\u529b\u5c31\u884c\u4e86\uff0c\u5176\u4ed6\u7684\u4ea4\u7ed9\u65f6\u95f4\uff01\" data-from=\"1\" data-is_biz_ban=\"0\"><\/mp-common-profile><br \/>\n<\/section>\n<p style=\"margin-bottom: 0px;\"><\/p>\n<section style=\"margin-bottom: 0px;outline: 0px;max-width: 100%;letter-spacing: 0.544px;white-space: normal;color: rgb(62, 62, 62);font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;font-weight: 700;text-align: left;widows: 1;word-spacing: 2px;caret-color: rgb(255, 0, 0);background-color: rgb(255, 255, 255);line-height: 2em;box-sizing: border-box !important;overflow-wrap: break-word !important;\">\n <span style=\"outline: 0px;max-width: 100%;color: rgb(255, 41, 65);letter-spacing: 2px;font-size: 14px;font-family: Optima-Regular, PingFangTC-light;box-sizing: border-box !important;overflow-wrap: break-word !important;\">\u76f8\u5173\u63a8\u8350\uff1a<\/span><br \/>\n<\/section>\n<ul class=\"list-paddingleft-1\" style=\"padding-left: 1.2em;outline: 0px;max-width: 100%;letter-spacing: 0.544px;white-space: normal;color: rgb(62, 62, 62);font-family: &quot;Helvetica Neue&quot;, Helvetica, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;font-size: 16px;font-weight: 700;text-align: left;widows: 1;word-spacing: 2px;caret-color: rgb(255, 0, 0);background-color: rgb(255, 255, 255);list-style-type: circle;overflow-wrap: break-word !important;\">\n<li style=\"outline: 0px;max-width: 100%;font-size: 14px;box-sizing: border-box !important;overflow-wrap: break-word !important;\">\n<section style=\"outline: 0px;max-width: 100%;line-height: 2em;box-sizing: border-box !important;overflow-wrap: break-word !important;\">\n   <a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzUyNTgzNDc3MQ==&amp;mid=2247493096&amp;idx=1&amp;sn=8dbe7f1f65a23ed3522070ca772430d8&amp;chksm=fa1aaa94cd6d2382c47e52a2d41f97887e59d256877b003a967976595a923bf17dc4f6de9375&amp;scene=21#wechat_redirect\" textvalue=\"SpringCloud\u7cfb\u5217\uff1aOpenFeign\u7ec4\u4ef6\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"2\" rel=\"noopener\" rel=\"nofollow\" >SpringCloud\u7cfb\u5217\uff1aOpenFeign\u7ec4\u4ef6<\/a><br \/>\n   <br style=\"outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><br \/>\n  <\/section>\n<\/li>\n<li style=\"outline: 0px;max-width: 100%;font-size: 14px;box-sizing: border-box !important;overflow-wrap: break-word !important;\">\n<section style=\"outline: 0px;max-width: 100%;line-height: 2em;box-sizing: border-box !important;overflow-wrap: break-word !important;\">\n   <a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzUyNTgzNDc3MQ==&amp;mid=2247493241&amp;idx=1&amp;sn=4fcca6175db136f515b3ffd89bcea557&amp;chksm=fa1aa905cd6d20133e3f45812670cd240698e23ad4cdf6b12ecadc4ea686538247aa1ce21d04&amp;scene=21#wechat_redirect\" textvalue=\"SpringCloud\u7cfb\u5217\uff1a\u5982\u4f55\u4f7f\u7528JWT\u8fdb\u884c\u8eab\u4efd\u9a8c\u8bc1\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"2\" rel=\"noopener\" rel=\"nofollow\" >SpringCloud\u7cfb\u5217\uff1a\u5982\u4f55\u4f7f\u7528JWT\u8fdb\u884c\u8eab\u4efd\u9a8c\u8bc1<\/a><br \/>\n   <br style=\"outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><br \/>\n  <\/section>\n<\/li>\n<li style=\"outline: 0px;max-width: 100%;font-size: 14px;box-sizing: border-box !important;overflow-wrap: break-word !important;\">\n<section style=\"outline: 0px;max-width: 100%;line-height: 2em;box-sizing: border-box !important;overflow-wrap: break-word !important;\">\n   <a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzUyNTgzNDc3MQ==&amp;mid=2247493301&amp;idx=1&amp;sn=edb58ba9e8bc9127df1dbe7881ee3784&amp;chksm=fa1aa9c9cd6d20df23953579d102b91e7a2a87ad1d7c66735f2c2cd46a5be8c7b72d0e4fe5a4&amp;scene=21#wechat_redirect\" textvalue=\"SpringCloud\u7cfb\u5217\uff1a\u670d\u52a1\u96ea\u5d29\u3001\u670d\u52a1\u7194\u65ad\u3001\u670d\u52a1\u964d\u7ea7\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"2\" rel=\"noopener\" rel=\"nofollow\" >SpringCloud\u7cfb\u5217\uff1a\u670d\u52a1\u96ea\u5d29\u3001\u670d\u52a1\u7194\u65ad\u3001\u670d\u52a1\u964d\u7ea7<\/a><br \/>\n   <br style=\"outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><br \/>\n  <\/section>\n<\/li>\n<li style=\"outline: 0px;max-width: 100%;font-size: 14px;box-sizing: border-box !important;overflow-wrap: break-word !important;\">\n<section style=\"outline: 0px;max-width: 100%;line-height: 2em;box-sizing: border-box !important;overflow-wrap: break-word !important;\">\n   <a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzUyNTgzNDc3MQ==&amp;mid=2247493338&amp;idx=1&amp;sn=9a4da5136fdf1525676a9a106f23ea39&amp;chksm=fa1aa9a6cd6d20b0e68f5c046b242897bea07ff692f4359f842890eb6c2c58e8650d3c9ad6de&amp;scene=21#wechat_redirect\" textvalue=\"SpringCloud\u7cfb\u5217\uff1aHystrix Dashboard\u7684\u7b80\u5355\u4f7f\u7528\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"2\" rel=\"noopener\" rel=\"nofollow\" >SpringCloud\u7cfb\u5217\uff1aHystrix Dashboard\u7684\u7b80\u5355\u4f7f\u7528<\/a><br \/>\n   <br style=\"outline: 0px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><br \/>\n  <\/section>\n<\/li>\n<li style=\"outline: 0px;max-width: 100%;font-size: 14px;box-sizing: border-box !important;overflow-wrap: break-word !important;\">\n<section style=\"outline: 0px;max-width: 100%;line-height: 2em;box-sizing: border-box !important;overflow-wrap: break-word !important;\">\n   <a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzUyNTgzNDc3MQ==&amp;mid=2247493363&amp;idx=1&amp;sn=38e0cf9f1452d38415c4461cfaa11d4e&amp;chksm=fa1aa98fcd6d20995dcc85309ff0b02932afb2abd995143f44e0bd11ec19a2fc9b23f9ce32f1&amp;scene=21#wechat_redirect\" textvalue=\"SpringCloud\u7cfb\u5217\uff1a\u670d\u52a1\u7f51\u5173\u7ec4\u4ef6Gateway\uff08\u4e0b\uff09\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"2\" rel=\"noopener\" rel=\"nofollow\" >SpringCloud\u7cfb\u5217\uff1a\u670d\u52a1\u7f51\u5173\u7ec4\u4ef6Gateway\uff08\u4e0b\uff09<\/a><br \/>\n   <br \/>\n  <\/section>\n<\/li>\n<li style=\"outline: 0px;max-width: 100%;font-size: 14px;box-sizing: border-box !important;overflow-wrap: break-word !important;\">\n<section style=\"outline: 0px;max-width: 100%;line-height: 2em;box-sizing: border-box !important;overflow-wrap: break-word !important;\">\n   <a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzUyNTgzNDc3MQ==&amp;mid=2247493350&amp;idx=1&amp;sn=815bd29cbf8e432cf8f6effafadcba68&amp;chksm=fa1aa99acd6d208c41dd027f7033c932017a470e7f7f01dc68eb624c2af53646608f6437bf4e&amp;scene=21#wechat_redirect\" textvalue=\"SpringCloud\u7cfb\u5217\uff1a\u670d\u52a1\u7f51\u5173\u7ec4\u4ef6Gateway\uff08\u4e0a\uff09\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"2\" rel=\"noopener\" rel=\"nofollow\" >SpringCloud\u7cfb\u5217\uff1a\u670d\u52a1\u7f51\u5173\u7ec4\u4ef6Gateway\uff08\u4e0a\uff09<\/a><br \/>\n  <\/section>\n<\/li>\n<\/ul>\n<p data-pid=\"LYLR2Kbn\" style=\"outline: 0px;max-width: 100%;color: rgba(0, 0, 0, 0.9);font-family: system-ui, -apple-system, BlinkMacSystemFont, &quot;Helvetica Neue&quot;, &quot;PingFang SC&quot;, &quot;Hiragino Sans GB&quot;, &quot;Microsoft YaHei UI&quot;, &quot;Microsoft YaHei&quot;, Arial, sans-serif;letter-spacing: 0.544px;white-space: normal;background-color: rgb(255, 255, 255);visibility: visible;box-sizing: border-box !important;overflow-wrap: break-word !important;\"><\/p>\n<section data-mpa-template=\"t\" style=\"margin-bottom: 0px;\">\n<section data-id=\"94711\">\n<section style=\"width:100%;text-align:right;\" data-width=\"100%\">\n<section style=\"display:inline-block;\">\n<section data-brushtype=\"text\" style=\"padding: 6px 12px 10px 14px;background-image: url(&quot;https:\/\/mmbiz.qpic.cn\/mmbiz_png\/b96CibCt70iaaBAicDNCSs6H0O0SBGSALfnl7BCsBU1noJP2AdKCs9ibu0ekH61eCzETvxANJYdHfzsrcam7O1tLNg\/640?wx_fmt=png&quot;);background-repeat: no-repeat;text-align: center;background-size: 100% 100%;font-size: 14px;letter-spacing: 2px;\">\n     &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\u6211\u5c31\u77e5\u9053\u4f60\u5728\u770b\uff01<br \/>\n    <\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<p style=\"display: none;\">\n <mp-style-type data-value=\"3\"><\/mp-style-type><\/p>\n<p>\u672c\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8e\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4f5c\u8005\uff1a\u539f\u521b \u6c5f\u590f 1024\u7b14\u8bb0 1024\u7b14\u8bb0 \u5fae\u4fe1\u53f7 Jang_1024 \u529f\u80fd\u4ecb\u7ecd \u52aa\u529b\u5c31\u884c\u4e86\uff0c\u5176\u4ed6\u7684\u4ea4\u7ed9\u65f6\u95f4\uff01 \u53d1\u8868\u4e8e<br \/>\u8f6c\u8f7d\u5730\u5740\uff1ahttps:\/\/mp.weixin.qq.com\/s\/AN0eKCARZAw11C1c040-qQ<\/p>\n","raw":"","protected":false},"excerpt":{"rendered":"<p>\u4f5c\u8005\u5e73\u53f0\uff1a | CSDN\uff1ahttps:\/\/blog.csdn.net\/qq_41153943\uff08ID\uff1a\u6c5f\u590f\u3001\uff09 | \u6398\u91d1\uff1ahttps &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[30],"tags":[],"class_list":["post-2974","post","type-post","status-publish","format-standard","hentry","category-30"],"post_thumbnail_image":"","content_first_image":null,"post_medium_image_300":"","post_thumbnail_image_624":"","post_frist_image":null,"post_medium_image":"","post_large_image":"","post_full_image":"","post_all_images":[],"videoAdId":"","listAd":"0","listAdId":"","listAdEvery":6,"total_comments":0,"category_name":"\u9762\u8bd5","post_date":"2023-07-14","like_count":"0","praiseWord":"\u9f13\u52b1","copyright_state":"","excitationAd":"0","rewardedVideoAdId":"","detailAdId":"","detailAd":"0","enterpriseMinapp":"0","audios":[],"postImageUrl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230519082947553.jpg","avatarurls":[],"related_posts":null,"pageviews":296,"next_post_id":2985,"next_post_title":"\u9762\u8bd5\u5b98\u95ee\uff1aSpringBoot\u4e2d\u6761\u4ef6\u6ce8\u89e3\u5e95\u5c42\u5982\u4f55\u5b9e\u73b0\u7684\uff1f","previous_post_id":2922,"previous_post_title":"2023\u5e74\u6700\u65b0kafka\u5e38\u89c1\u9762\u8bd5\u9898","_links":{"self":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/2974","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/comments?post=2974"}],"version-history":[{"count":0,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/2974\/revisions"}],"wp:attachment":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=2974"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=2974"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=2974"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}