class FutureSubscriber extends CountDownLatch implements FlowableSubscriber<T>, Future<T>, Subscription {

    @Override
    public void onError(Throwable t) {
        for (;;) {
            Subscription a = s.get();
            if (a == this || a == SubscriptionHelper.CANCELLED) {
                RxJavaPlugins.onError(t);
                return;
            }
            error = t;
            if (s.compareAndSet(a, this)) {
                countDown();
                return;
            }
        }
    }

    public  FutureSubscriber();

}