def __init__(self, threadsafe=False, shared=None):
    self._threadsafe = threadsafe
    if (self._threadsafe and (shared is None)):
        self._buffer = None
        self._queue = multiprocessing.SimpleQueue()
        self._worker = False
        self._data = {}
    elif (shared and ('queue' in shared)):
        self._buffer = {}
        self._queue = shared['queue']
        self._worker = True
        self._data = None
    elif (shared and ('data' in shared)):
        self._buffer = None
        self._queue = None
        self._worker = False
        self._data = shared['data']
    else:
        self._buffer = None
        self._queue = None
        self._worker = False
        self._data = {}
def __init__(self, threadsafe=False, shared=None):
    self._threadsafe = threadsafe
    if (self._threadsafe and (shared is None)):
        self._buffer = None
        self._queue = multiprocessing.SimpleQueue()
        self._worker = False
        self._data = {}
    elif (shared and ('queue' in shared)):
        self._buffer = {}
        self._queue = shared['queue']
        self._worker = True
        self._data = None
    elif (shared and ('data' in shared)):
        self._buffer = None
        self._queue = None
        self._worker = False
        self._data = shared['data']
    else:
        self._buffer = None
        self._queue = None
        self._worker = False
        self._data = {}