mirror of
https://github.com/GTNewHorizons/CodeChickenCore.git
synced 2026-11-16 01:54:50 +00:00
Initial commit
This commit is contained in:
commit
0d94e9ac7f
78 files changed
+7045
No files matched your search
@@ -0,0 +1,38 @@
|
||||
package codechicken.core;
|
||||
|
||||
public class ReentrantCheck
|
||||
{
|
||||
private boolean entered;
|
||||
|
||||
public ReentrantCheck()
|
||||
{
|
||||
entered = false;
|
||||
}
|
||||
|
||||
public boolean entered()
|
||||
{
|
||||
return entered;
|
||||
}
|
||||
|
||||
public void enter()
|
||||
{
|
||||
entered = true;
|
||||
}
|
||||
|
||||
public void exit()
|
||||
{
|
||||
entered = false;
|
||||
}
|
||||
|
||||
public static ThreadLocal<ReentrantCheck> threadLocal()
|
||||
{
|
||||
return new ThreadLocal<ReentrantCheck>()
|
||||
{
|
||||
@Override
|
||||
protected ReentrantCheck initialValue()
|
||||
{
|
||||
return new ReentrantCheck();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user