def METHOD_NAME(self, obj):
    # serialize the data before acquiring the lock
    obj = dumps(obj, reducers=self._reducers)
    if self._wlock is None:
        # writes to a message oriented win32 pipe are atomic
        self._writer.send_bytes(obj)
    else:
        with self._wlock:
            self._writer.send_bytes(obj)