当前位置:网站首页>Use of RLOCK lock
Use of RLOCK lock
2022-07-05 15:58:00 【Ant HJK】
try { RLock lock = redissonClient.getLock("ppt:pos:sms:code:lock:" + "orderSmsCode"); System.out.println(" Get the lock "); // Attempt to acquire lock boolean success = lock.tryLock(30, 60, TimeUnit.SECONDS); if(success){ System.out.println(" Lock acquired successfully "); } // If the current thread still holds the lock , Then release the lock ( Prevent exceeding a certain time , Auto unlock ) if(lock.isHeldByCurrentThread()) { lock.unlock(); } } catch (InterruptedException e) { e.printStackTrace(); }
边栏推荐
猜你喜欢
具有倍数关系的时钟切换
ES6深入—ES6 Generator 函数
lv_ font_ Conv offline conversion
抽象类和接口的区别
Appium automation test foundation - appium basic operation API (I)
[brief notes] solve the problem of IDE golang code red and error reporting
【简记】解决IDE golang 代码飘红报错
Ionic Cordova project modification plug-in
Summary of the third class
The OBD deployment mode of oceanbase Community Edition is installed locally
随机推荐
16.[STM32]从原理开始带你了解DS18B20温度传感器-四位数码管显示温度
Optional parameters in the for loop
lvgl 显示图片示例
I spring and autumn blasting-2
20. [stm32] realize the function of intelligent garbage can by using ultrasonic module and steering gear
list使用Stream流进行根据元素某属性数量相加
19.[STM32]HC_ SR04 ultrasonic ranging_ Timer mode (OLED display)
Arduino控制微小的六足3D打印机器人
Replknet: it's not that large convolution is bad, but that convolution is not large enough. 31x31 convolution. Let's have a look at | CVPR 2022
Analytic hierarchy process of mathematical modeling (including Matlab code)
MySQL overview
17.[STM32]仅用三根线带你驱动LCD1602液晶
ES6深入—ES6 Generator 函数
Bugku cyberpunk
Summary of the second lesson
RepLKNet:不是大卷积不好,而是卷积不够大,31x31卷积了解一下 | CVPR 2022
Dataarts studio data architecture - Introduction to data standards
【 note 】 résoudre l'erreur de code IDE golang
把 ”中台“ 的思想迁移到代码中去
机械臂速成小指南(九):正运动学分析