Add support for external thread events
commit88687ba6f74187749e1a5c57262eee828610f228
authorJan Oravec <jan@fb.com>
Mon, 22 Apr 2013 03:38:27 +0000 (21 20:38 -0700)
committerSara Golemon <sgolemon@fb.com>
Thu, 2 May 2013 17:14:16 +0000 (2 10:14 -0700)
tree2297c82b747d72b2db77079633c1fbb62feb8907
parent8f3e34430ce619f09f032ad6252ce9e840d860e6
Add support for external thread events

Add support for external thread events.

See asio_external_thread_event.h for details about usage.

This is the first version that compiled, the code was not executed even
once, but wanted to get it out early to unblock @hannesr. Thus the [RFC]
flag.

My next step is to implement asio-compatible equivalent of
fb_call_user_func_async() that will make it possible to easily test the
new functonality by simulating async stuff with sleep(), etc. on the PHP
side.

There are 2 major mostly lockless synchronization points that needs
careful review:

- queue of ready external thread events (asio_session.{cpp.h})
- shutdown cleanup (asio_external_thread_event.{cpp,h})
hphp/idl/asio.idl.json
hphp/runtime/ext/asio/asio_context.cpp
hphp/runtime/ext/asio/asio_context.h
hphp/runtime/ext/asio/asio_external_thread_event.cpp [new file with mode: 0644]
hphp/runtime/ext/asio/asio_external_thread_event.h [new file with mode: 0644]
hphp/runtime/ext/asio/asio_session.cpp
hphp/runtime/ext/asio/asio_session.h
hphp/runtime/ext/asio/external_thread_event_wait_handle.cpp [new file with mode: 0644]
hphp/runtime/ext/ext_asio.h
hphp/system/class_map.cpp