提交 fa845b64 编写于 作者: L liulei33

summit

上级 800093b5
package com.Mrliu.thread;
package com.Mrliu.thread.base;
import java.util.concurrent.TimeUnit;
......
package com.Mrliu.thread;
package com.Mrliu.thread.base;
import java.util.concurrent.TimeUnit;
......
package com.Mrliu.thread;
package com.Mrliu.thread.base;
import java.util.concurrent.TimeUnit;
......
package com.Mrliu.thread;
package com.Mrliu.thread.base;
import java.util.ArrayList;
import java.util.concurrent.TimeUnit;
/**
......
package com.Mrliu.thread.concurrent.syn;
import java.util.concurrent.locks.AbstractQueuedSynchronizer;
/**
* @ClassName AQSTest
* @Description AbstractQueueSynchronizer
* @Author liulei33
* @Time 2020/3/25 11:57
*/
public class AQSTest {
public static void main(String[] args) {
// AbstractQueuedSynchronizer
}
}
package com.Mrliu.thread.concurrent.syn;
/**
* @ClassName ConditionTest
* @Description 条件变量
* @Author liulei33
* @Time 2020/3/25 12:02
*/
public class ConditionTest {
}
package com.Mrliu.thread.concurrent.syn;
/**
* @ClassName LockSupportTest
* @Description 新通知机制
* @Author liulei33
* @Time 2020/3/25 12:03
*/
public class LockSupportTest {
}
package com.Mrliu.thread.concurrent.syn;
/**
* @ClassName LocksTest
* @Description TODO
* @Author liulei33
* @Time 2020/3/25 12:04
*/
public class LocksTest {
}
package com.Mrliu.thread.concurrent.syn;
/**
* @ClassName ReentrantRadeWaitLockTest
* @Description 重入读写锁
* @Author liulei33
* @Time 2020/3/25 12:00
*/
public class ReentrantRadeWaitLockTest {
}
package com.Mrliu.thread.concurrent.syn;
/**
* @ClassName ReenttrantLockTest
* @Description ReenttrantLock:公平非公平锁
* @Author liulei33
* @Time 2020/3/25 11:59
*/
public class ReenttrantLockTest {
}
package com.Mrliu.thread.concurrent.syn;
/**
* @ClassName SynchronizedTest
* @Description Synchronized为对象锁,锁的范围为对象的生命周期
* @Author liulei33
* @Time 2020/3/25 12:03
*/
public class SynchronizedTest {
private static Object lock;
//对象锁,等同于test2;test2的锁范围 <= test1
//锁的生命周期:伴随着对象的生命周期,new SynchronizedTest()
public synchronized void test1(){
//todo
}
public void test2(){
//todo
synchronized(this){
//todo
}
//todo
}
//类锁,等同于test4,test4的缩范围 <= test3
//锁的生命周期伴随着class类的生命周期
public synchronized static void test3(){
}
public void test4(){
//todo
synchronized (lock){
//todo
}
//todo
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册