On Sep 11, 8:34 pm, Stephan Beal <[email protected]> wrote:
> i seem to have setTimeout() working in v8, using pthreads for the
> threading and usleep() (from unistd.h) for the delay. Before i post
> the code and ask for critiques regarding the my use of v8::Locker/
> Unlocker...

The setTimeout()/clearTimeout() routines appear to work as expected.
The code is available here:

http://code.google.com/p/v8-juice/source/browse/trunk/src/include/v8/juice/time.h
http://code.google.com/p/v8-juice/source/browse/trunk/src/lib/juice/time.cc

External requirements: usleep(3) and pthreads.

There's one #define which needs to be set in order to compile it
outside the context of the v8-juice source tree, but other than that
it should be usable on POSIX platforms. When compiling outside of the
v8-juice tree it will use a dummy/no-op mutex for "locking" the timer
list. Clients may wish to replace that with a mutex of their choice.

Happy hacking!


--~--~---------~--~----~------------~-------~--~----~
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to