Skip to content

Commit

Permalink
simplify error path
Browse files Browse the repository at this point in the history
  • Loading branch information
shikokuchuo committed Oct 25, 2024
1 parent 1622227 commit 3a46f35
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/fd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,7 @@ Rcpp::RObject execLater_fd(Rcpp::Function callback, Rcpp::IntegerVector readfds,

tct_thrd_t thr;
if (tct_thrd_create(&thr, &wait_thread, static_cast<void *>(argsptr.release())) != tct_thrd_success)
#ifdef _WIN32
Rcpp::stop("Thread creation error: " + std::to_string(GetLastError()));
#else
Rcpp::stop("Thread creation error: " + std::string(strerror(errno)));
#endif
Rcpp::stop("Thread creation failed");
tct_thrd_detach(thr);

Rcpp::XPtr<std::shared_ptr<std::atomic<bool>>> xptr(new std::shared_ptr<std::atomic<bool>>(flag), true);
Expand Down

0 comments on commit 3a46f35

Please sign in to comment.