当前位置: 首页>>代码示例>>Java>>正文


Java ORBUtility.dprintTrace方法代码示例

本文整理汇总了Java中com.sun.corba.se.impl.orbutil.ORBUtility.dprintTrace方法的典型用法代码示例。如果您正苦于以下问题:Java ORBUtility.dprintTrace方法的具体用法?Java ORBUtility.dprintTrace怎么用?Java ORBUtility.dprintTrace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.corba.se.impl.orbutil.ORBUtility的用法示例。


在下文中一共展示了ORBUtility.dprintTrace方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: release

import com.sun.corba.se.impl.orbutil.ORBUtility; //导入方法依赖的package包/类
public synchronized void release()
{
    try {
        if (debug)
            ORBUtility.dprintTrace( this, "release enter: " +
                " holder_=" + ORBUtility.getThreadName(holder_) +
                " counter_=" + counter_ ) ;

        Thread thr = Thread.currentThread();
        if (thr != holder_)
            throw new INTERNAL(
                "Attempt to release Mutex by thread not holding the Mutex" ) ;
        else
            counter_ -- ;

        if (counter_ == 0) {
            holder_ = null;
            notify();
        }
    } finally {
        if (debug)
            ORBUtility.dprintTrace( this, "release exit: " +
                " holder_=" + ORBUtility.getThreadName(holder_) +
                " counter_=" + counter_ ) ;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:ReentrantMutex.java

示例2: releaseAll

import com.sun.corba.se.impl.orbutil.ORBUtility; //导入方法依赖的package包/类
synchronized int releaseAll()
{
    try {
        if (debug)
            ORBUtility.dprintTrace( this, "releaseAll enter: " +
                " holder_=" + ORBUtility.getThreadName(holder_) +
                " counter_=" + counter_ ) ;

        Thread thr = Thread.currentThread();
        if (thr != holder_)
            throw new INTERNAL(
                "Attempt to releaseAll Mutex by thread not holding the Mutex" ) ;

        int result = counter_ ;
        counter_ = 0 ;
        holder_ = null ;
        notify() ;
        return result ;
    } finally {
        if (debug)
            ORBUtility.dprintTrace( this, "releaseAll exit: " +
                " holder_=" + ORBUtility.getThreadName(holder_) +
                " counter_=" + counter_ ) ;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:ReentrantMutex.java

示例3: acquire

import com.sun.corba.se.impl.orbutil.ORBUtility; //导入方法依赖的package包/类
public void acquire() throws InterruptedException {
    if (Thread.interrupted())
        throw new InterruptedException();

    synchronized(this) {
        try {
            if (debug)
                ORBUtility.dprintTrace( this,
                    "acquire enter: holder_=" +
                    ORBUtility.getThreadName(holder_) +
                    " counter_=" + counter_ ) ;

            Thread thr = Thread.currentThread();
            if (holder_ != thr) {
                try {
                    while (counter_ > 0)
                        wait();

                    // This can't happen, but make sure anyway
                    if (counter_ != 0)
                        throw new INTERNAL(
                            "counter not 0 when first acquiring mutex" ) ;

                    holder_ = thr;
                } catch (InterruptedException ex) {
                    notify();
                    throw ex;
                }
            }

            counter_ ++ ;
        } finally {
            if (debug)
                ORBUtility.dprintTrace( this, "acquire exit: holder_=" +
                ORBUtility.getThreadName(holder_) + " counter_=" +
                counter_ ) ;
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:40,代码来源:ReentrantMutex.java

示例4: acquireAll

import com.sun.corba.se.impl.orbutil.ORBUtility; //导入方法依赖的package包/类
void acquireAll( int count ) throws InterruptedException
{
    if (Thread.interrupted())
        throw new InterruptedException();

    synchronized(this) {
        try {
            if (debug)
                ORBUtility.dprintTrace( this,
                    "acquireAll enter: count=" + count + " holder_=" +
                    ORBUtility.getThreadName(holder_) + " counter_=" +
                    counter_ ) ;
            Thread thr = Thread.currentThread();
            if (holder_ == thr) {
                throw new INTERNAL(
                    "Cannot acquireAll while holding the mutex" ) ;
            } else {
                try {
                    while (counter_ > 0)
                        wait();

                    // This can't happen, but make sure anyway
                    if (counter_ != 0)
                        throw new INTERNAL(
                            "counter not 0 when first acquiring mutex" ) ;

                    holder_ = thr;
                } catch (InterruptedException ex) {
                    notify();
                    throw ex;
                }
            }

            counter_ = count ;
        } finally {
            if (debug)
                ORBUtility.dprintTrace( this, "acquireAll exit: count=" +
                count + " holder_=" + ORBUtility.getThreadName(holder_) +
                " counter_=" + counter_ ) ;
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:43,代码来源:ReentrantMutex.java

示例5: attempt

import com.sun.corba.se.impl.orbutil.ORBUtility; //导入方法依赖的package包/类
public boolean attempt(long msecs) throws InterruptedException {
    if (Thread.interrupted())
        throw new InterruptedException();

    synchronized(this) {
        try {
            if (debug)
                ORBUtility.dprintTrace( this, "attempt enter: msecs=" +
                    msecs + " holder_=" +
                    ORBUtility.getThreadName(holder_) +
                    " counter_=" + counter_ ) ;

            Thread thr = Thread.currentThread() ;

            if (counter_==0) {
                holder_ = thr;
                counter_ = 1 ;
                return true;
            } else if (msecs <= 0) {
                return false;
            } else {
                long waitTime = msecs;
                long start = System.currentTimeMillis();
                try {
                    for (;;) {
                        wait(waitTime);
                        if (counter_==0) {
                            holder_ = thr;
                            counter_ = 1 ;
                            return true;
                        } else {
                            waitTime = msecs -
                                (System.currentTimeMillis() - start);

                            if (waitTime <= 0)
                                return false;
                        }
                    }
                } catch (InterruptedException ex) {
                    notify();
                    throw ex;
                }
            }
        } finally {
            if (debug)
                ORBUtility.dprintTrace( this, "attempt exit: " +
                    " holder_=" + ORBUtility.getThreadName(holder_) +
                    " counter_=" + counter_ ) ;
        }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:52,代码来源:ReentrantMutex.java


注:本文中的com.sun.corba.se.impl.orbutil.ORBUtility.dprintTrace方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。