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


Python dummy_thread.allocate_lock方法代码示例

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


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

示例1: __init__

# 需要导入模块: import dummy_thread [as 别名]
# 或者: from dummy_thread import allocate_lock [as 别名]
def __init__(self, application, environ=None,
                 multithreaded=True, **kw):
        """
        environ, if present, must be a dictionary-like object. Its
        contents will be copied into application's environ. Useful
        for passing application-specific variables.

        Set multithreaded to False if your application is not MT-safe.
        """
        if kw.has_key('handler'):
            del kw['handler'] # Doesn't make sense to let this through
        super(WSGIServer, self).__init__(**kw)

        if environ is None:
            environ = {}

        self.application = application
        self.environ = environ
        self.multithreaded = multithreaded

        # Used to force single-threadedness
        self._app_lock = thread.allocate_lock() 
开发者ID:uwdata,项目名称:termite-visualizations,代码行数:24,代码来源:fcgi.py

示例2: allocate_lock

# 需要导入模块: import dummy_thread [as 别名]
# 或者: from dummy_thread import allocate_lock [as 别名]
def allocate_lock():
    """Dummy implementation of thread.allocate_lock()."""
    return LockType() 
开发者ID:glmcdona,项目名称:meddle,代码行数:5,代码来源:dummy_thread.py

示例3: __init__

# 需要导入模块: import dummy_thread [as 别名]
# 或者: from dummy_thread import allocate_lock [as 别名]
def __init__(self, raw, buffer_size=DEFAULT_BUFFER_SIZE):
        """Create a new buffered reader using the given readable raw IO object.
        """
        if not raw.readable():
            raise IOError('"raw" argument must be readable.')

        _BufferedIOMixin.__init__(self, raw)
        if buffer_size <= 0:
            raise ValueError("invalid buffer size")
        self.buffer_size = buffer_size
        self._reset_read_buf()
        self._read_lock = Lock() 
开发者ID:glmcdona,项目名称:meddle,代码行数:14,代码来源:_pyio.py

示例4: setUp

# 需要导入模块: import dummy_thread [as 别名]
# 或者: from dummy_thread import allocate_lock [as 别名]
def setUp(self):
        # Create a lock
        self.lock = _thread.allocate_lock() 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:5,代码来源:test_dummy_thread.py

示例5: test_LockType

# 需要导入模块: import dummy_thread [as 别名]
# 或者: from dummy_thread import allocate_lock [as 别名]
def test_LockType(self):
        #Make sure _thread.LockType is the same type as _thread.allocate_locke()
        self.assertIsInstance(_thread.allocate_lock(), _thread.LockType,
                              "_thread.LockType is not an instance of what "
                              "is returned by _thread.allocate_lock()") 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:7,代码来源:test_dummy_thread.py

示例6: __init__

# 需要导入模块: import dummy_thread [as 别名]
# 或者: from dummy_thread import allocate_lock [as 别名]
def __init__(self, play, proxy=True, strict=True, dump=True, recurse_lock=False, **options):
        super(Replay, self).__init__(play._target, **options)
        self._calls, self._expected, self._actual = ChainMap(self._calls, play._calls), play._calls, self._calls

        self._proxy = proxy
        self._strict = strict
        self._dump = dump
        self._context = play._context
        self._recurse_lock = allocate_lock() if recurse_lock is True else (recurse_lock and recurse_lock()) 
开发者ID:ionelmc,项目名称:python-aspectlib,代码行数:11,代码来源:test.py

示例7: __init__

# 需要导入模块: import dummy_thread [as 别名]
# 或者: from dummy_thread import allocate_lock [as 别名]
def __init__(self):
        object.__setattr__(self, '__storage__', {})
        object.__setattr__(self, '__lock__', allocate_lock()) 
开发者ID:google,项目名称:googleapps-message-recall,代码行数:5,代码来源:local.py

示例8: __init__

# 需要导入模块: import dummy_thread [as 别名]
# 或者: from dummy_thread import allocate_lock [as 别名]
def __init__(self):
        self.mutex = _thread.allocate_lock()
        self.dict = {} 
开发者ID:abdesslem,项目名称:malwareHunter,代码行数:5,代码来源:util.py


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