This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import absolute_import, division, print_function, unicode_literals | |
from multiprocessing.dummy import Pool as ThreadPool | |
from multiprocessing import Lock | |
from threading import get_ident | |
class SingletonType(type): | |
def __new__(mcs, name, bases, attrs): | |
# Assume the target class is created (i.e. this method to be called) in the main thread. |