Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Jc Hong
Added: Jan 8, 2021 5:52 AM
Modified: Jan 8, 2021 5:52 AM
Views: 1
Tags: no tags
  1.     private ReentrantLock reentrantLock = new ReentrantLock();
  2.  
  3.     @BeforeEach
  4.     public void beforeEachTest() {
  5.         reentrantLock.lock();
  6.     }
  7.  
  8.     @AfterEach
  9.     public void afterEachTest() {
  10.         reentrantLock.unlock();
  11.     }