Skip to content

feature request, make threads optional #10

Description

@panjea

this is a great minimal library, thanks!
it would be nice have std::thread as an ifdef option.
these are my changes, not tested yet.

line 29

#ifdef KSEQPP_THREADS
  #include <thread>
#endif

line 100

#ifdef KSEQPP_THREADS
        std::thread worker;                             /**< @brief worker thread */
#endif

line 430

          inline void
        worker_join( )
        {
#ifdef KSEQPP_THREADS
          this->async_write( true );
          if ( this->worker.joinable() ) this->worker.join();
#else
          this->async_write( false );
#endif
        }

          inline void
        worker_start( )
        {
#ifdef KSEQPP_THREADS
          this->worker = std::thread( &KStream::writer, this );
#else
          this->writer();
#endif
        }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions