code: public boolean becomePublisher() {
          if (publisherThreadID.get() != -1) {
              return false;
          }
          publisherThreadID.set(Thread.currentThread().getId());
          return true;
      }
docs: Attempts to make the thread the publisher, returning true if the attempt succeeded. This is only possible if there's no publisher.
  
  @return Whether or not the thread became the publisher