Java Utililty Methods Thread Lock

List of utility methods to do Thread Lock

  1. HOME
  2. Java
  3. T
  4. Thread Lock

Description

The list of methods to do Thread Lock are organized into topic(s).

Method

boolean canCreateNewThread()
can Create New Thread
if (Thread.activeCount() < 20000) {
 try {
 return true;
 } catch (Exception e) {
 e.printStackTrace();
return false;
...
Queue createConcurrentStack()
create Concurrent Stack
return (Queue<E>) Collections.asLifoQueue(newConcurrentNonBlockingDeque());
void downgradeWriteLock(final ReadWriteLock lock)
downgrade Write Lock
acquireReadLock(lock);
releaseWriteLock(lock);
void fillReadWriteLocks(List readLocks, List writeLocks, int curSize, int size)
fill Read Write Locks
if (curSize < size) {
 for (int i = curSize; i < size; i++) {
 ReentrantReadWriteLock nrwl = new ReentrantReadWriteLock();
 readLocks.add(nrwl.readLock());
 writeLocks.add(nrwl.writeLock());
Map getAllMessages()
get All Messages
return getLocaleProperties(getLocale());
Lock getGradingReadLock()
get Grading Read Lock
return READ_WRITE_LOCK.readLock();
Gson getInstance()
get Instance
return SERIALIZER;
Map getLocaleProperties(Locale locale)
Get the messages for a locale.
Set<String> loadedBundles = null;
Map<String, String> props = null;
int loadedBundleCount = 0;
try {
 readLock.lock();
 loadedBundles = loadedResourceBundles.get(locale);
 props = cachedMessages.get(locale);
 loadedBundleCount = resouceBundleBaseNames.size();
...
ReentrantReadWriteLock getPropLock(String s)
get Prop Lock
assert Thread.holdsLock(LOCK_MONITOR);
if (locks.containsKey(s)) {
 return locks.get(s);
ReentrantReadWriteLock l = new ReentrantReadWriteLock();
locks.put(s, l);
return l;
Class loadClass(String className)
Loads a class.
ClassLoader ccl = Thread.currentThread().getContextClassLoader();
if (ccl == null) {
 try {
 return loadClass(className, null);
 } catch (ClassNotFoundException cnf) {
 return loadClassWithRegisteredClassLoaders(className);
try {
 return loadClass(className, ccl);
} catch (ClassNotFoundException cnf) {
 try {
 return loadClass(className, null);
 } catch (ClassNotFoundException cnf2) {
 return loadClassWithRegisteredClassLoaders(className);


AltStyle によって変換されたページ (->オリジナル) /