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

Hi, I have some question for the code #51

Closed
fatezhou opened this issue Sep 29, 2017 · 3 comments
Closed

Hi, I have some question for the code #51

fatezhou opened this issue Sep 29, 2017 · 3 comments

Comments

@fatezhou
Copy link

at first thanks for your code ;
I use your code , but when I have a request that how could I accomplish the function like setTimeout?
the setTimeout's first paramiter maybe a lambda, so , how could I run this lambda? wait for your apply!

many thanks!

@ccxvii
Copy link
Owner

ccxvii commented Oct 3, 2017

See the "Calling functions" section in the reference manual, and the "Callbacks from C to JS" examples.

@fatezhou
Copy link
Author

fatezhou commented Oct 5, 2017

Thank you for your apply,
I try! when the lambda run right now, it can work correctly, BUT, How could I delay the lambda run later?
Just like , setTimeout(function(){ do something; }, 1000); I want to run the "do something" after 1000ms later, but it's crashed ( :<)

@ccxvii
Copy link
Owner

ccxvii commented Nov 7, 2017

The js_State context must only be used from a single thread. Don't share a js_State between threads, and don't call MuJS functions in signal handlers.

@ccxvii ccxvii closed this as completed Nov 7, 2017
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

2 participants