Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does QuickJS support multithreading? #53

Open
ShubhamPatil007 opened this issue Apr 26, 2022 · 0 comments
Open

Does QuickJS support multithreading? #53

ShubhamPatil007 opened this issue Apr 26, 2022 · 0 comments

Comments

@ShubhamPatil007
Copy link

I have a function written in JavaScript. I have created a callback in C++ as following:

void callbackFunction( int val ) {
   try {
      auto cb = (std::function<void(int val)>) context.eval("run");
      cb(val);
   }
   catch {
      ...
   }
}

I want to put callbackFunction() on a thread, std::thread(callbackFunction, val).detach(). But this always end up with terminate called after throwing an instance of 'qjs::exception'

How can I use multithreading in quickjs? Is there any workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant