From 37a145e95fb10378ffe1c298579669b95c16e338 Mon Sep 17 00:00:00 2001
From: liurunyu <lry9898@163.com>
Date: 星期一, 27 十一月 2023 14:30:42 +0800
Subject: [PATCH] limit中start、count设置,javaType=Integer
---
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/queue/Queue.java | 27 ++++++++++++++++++---------
1 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/queue/Queue.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/queue/Queue.java
index cfa77d5..13114af 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/queue/Queue.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/queue/Queue.java
@@ -4,7 +4,7 @@
import org.apache.logging.log4j.Logger;
/**
- * 闃熷垪锛屽厛杩涘厛鍑�
+ * 闃熷垪锛屽厛杩涘厛鍑猴紝闈炵嚎绋嬪畨鍏�
*/
public class Queue {
@SuppressWarnings("unfinal")
@@ -62,6 +62,7 @@
*/
@SuppressWarnings("unused")
public void pushHead(NodeObj obj)throws Exception{
+ //涓や釜绾跨▼鐜锛岄渶瑕佸悓姝ラ攣
synchronized(synObj){
if(obj == null){
return ;
@@ -89,6 +90,7 @@
* @param obj 鍏ュ垪鐨勫璞�
*/
public void pushTail(NodeObj obj)throws Exception{
+ //涓や釜绾跨▼鐜锛岄渶瑕佸悓姝ラ攣
synchronized(synObj){
if(obj == null){
return ;
@@ -116,6 +118,7 @@
* @return 鍑哄垪瀵硅薄
*/
public NodeObj pop(){
+ //涓や釜绾跨▼鐜锛岄渶瑕佸悓姝ラ攣
synchronized(synObj){
NodeObj obj = null ;
if(this.size > 0){
@@ -139,11 +142,14 @@
*/
@SuppressWarnings("unused")
public Node getFirstNode(){
- Node node = this.head.next ;
- if(node != this.tail){
- return node ;
+ //涓や釜绾跨▼鐜锛岄渶瑕佸悓姝ラ攣
+ synchronized(synObj) {
+ Node node = this.head.next;
+ if (node != this.tail) {
+ return node;
+ }
+ return null;
}
- return null ;
}
/**
* 寰楀埌鏈�鍚庝竴涓妭鐐癸紝浣嗕笉鎶婅妭鐐逛粠闃熷垪涓竻闄�
@@ -151,11 +157,14 @@
*/
@SuppressWarnings("unused")
public Node getLastNode(){
- Node node = this.tail.pre ;
- if(node != this.head){
- return node ;
+ //涓や釜绾跨▼鐜锛岄渶瑕佸悓姝ラ攣
+ synchronized(synObj) {
+ Node node = this.tail.pre;
+ if (node != this.head) {
+ return node;
+ }
+ return null;
}
- return null ;
}
/**
--
Gitblit v1.8.0