public static SixModelObject getlockcondvar(SixModelObject lock, SixModelObject type, ThreadContext tc) {
if (!(lock instanceof ReentrantMutexInstance))
throw ExceptionHandling.dieInternal(tc, "getlockcondvar requires an operand with REPR ReentrantMutex");
if (!(type.st.REPR instanceof ConditionVariable))
throw ExceptionHandling.dieInternal(tc, "getlockcondvar requires a result type with REPR ConditionVariable");
ConditionVariableInstance result = new ConditionVariableInstance();
result.st = type.st;
result.condvar = ((ReentrantMutexInstance)lock).lock.newCondition();
return result;
}