在/etc/profile.d目录里下新建 shell脚本 (设置alias别名命令的功能) 让新建的别名生效 设置完成后之际可以使用别名 gj 命令 执行poweroff一样效果的 ...
分类:
其他好文 时间:
2021-04-20 14:33:22
阅读次数:
0
1.synchronized关键字 1.1什么意思 synchronized关键字主要是用来解决多个线程访问资源的同步性,也就是保证被修饰的方法或者代码块任意时刻都只能有一个线程在执行。 底层实现是在修饰的前后加上minitorenter/minitorexit: minitorenter:当需要获 ...
分类:
编程语言 时间:
2021-04-20 14:32:00
阅读次数:
0
1、编写脚本 createuser.sh,实现如下功能:使用一个用户名作为参数,如果 指定参数的用户存在,就显示其存在,否则添加之;显示添加的用户的id号等信息 read -p " input the user: " USER if id $USER &> /dev/null ; then echo ...
分类:
系统相关 时间:
2021-04-20 14:31:15
阅读次数:
0
JUC并发编程 java.util.ConcurrentModificationException 并发修改异常 多线程基础 普通线程代码Thread Runnable没有返回值,效率相比于Callable慢 线程和进程 进程:一个程序,程序的集合 一个进程往往可以包含多个线程至少包含一个 java ...
分类:
其他好文 时间:
2021-04-20 14:17:55
阅读次数:
0
通过nginx -t获得 nginx=`nginx -t 2>&1 | grep configuration` if [ ! -z "$nginx" ];then nginxtmp="${nginx#*file}" nginxf="${nginxtmp%test*}" echo $nginxf fi ...
分类:
系统相关 时间:
2021-04-19 15:38:16
阅读次数:
0
Explorer.EXE该文件没有与之关联的应用来执行该操作。请安装应用,若已经安装应用,请在"默认应用设置"页面中创建关联。 添加如下注册表信息即可解决: Windows Registry Editor Version 5.00 [[HKEY_CLASSES_ROOT\Folder\shell\e ...
分类:
其他好文 时间:
2021-04-19 15:11:29
阅读次数:
0
from threading import Thread # 方式一 # def sub_thread(): # for i in range(11): # print(i) # def main(): # t = Thread(target=sub_thread) # t.start() # fo ...
分类:
编程语言 时间:
2021-04-19 14:46:14
阅读次数:
0
之前写了一下synchronized关键字的一点东西,那么除了synchronized可以加锁外,JUC(java.util.concurrent)提供的Lock接口也可以实现加锁解锁的功能。 看完本文,希望您可以了解或者掌握: 1:Lock接口的实现 2:Condition的原理和概念 3:Ree ...
分类:
编程语言 时间:
2021-04-19 14:42:58
阅读次数:
0
题目: 我们提供一个类: class FooBar { public void foo() { for (int i = 0; i < n; i++) { print("foo"); } } public void bar() { for (int i = 0; i < n; i++) { prin ...
分类:
编程语言 时间:
2021-04-19 14:40:03
阅读次数:
0
💛线程的几个状态 💛线程终止 想要终止一个线程的时候, 不推荐使用使用java里面的stop(), destory()以及一些过期的方法, 我们可以使用标志变量来控制让线程自行终止, 这相对来说是比较安全的一种方式. package com.smile.test.thread; public c ...
分类:
编程语言 时间:
2021-04-16 12:26:24
阅读次数:
0