Commit 21d7adcd authored by Lucian Grijincu's avatar Lucian Grijincu Committed by Facebook Github Bot

folly: AsyncSignalHandler: update comments to match code

Summary: #accept2ship

Reviewed By: jsedgwick

Differential Revision: D4105140

fbshipit-source-id: eca1f7066e514ec3c5d316f974edc34e03872784
parent ec1cb4c0
...@@ -24,17 +24,19 @@ namespace folly { ...@@ -24,17 +24,19 @@ namespace folly {
/** /**
* A handler to receive notification about POSIX signals. * A handler to receive notification about POSIX signals.
* *
* TAsyncSignalHandler allows code to process signals from within a EventBase * AsyncSignalHandler allows code to process signals from within a EventBase
* loop. Standard signal handlers interrupt execution of the main thread, and * loop.
*
* Standard signal handlers interrupt execution of the main thread, and
* are run while the main thread is paused. As a result, great care must be * are run while the main thread is paused. As a result, great care must be
* taken to avoid race conditions if the signal handler has to access or modify * taken to avoid race conditions if the signal handler has to access or modify
* any data used by the main thread. * any data used by the main thread.
* *
* TAsyncSignalHandler solves this problem by running the TAsyncSignalHandler * AsyncSignalHandler solves this problem by running the AsyncSignalHandler
* callback in normal thread of execution, as a EventBase callback. * callback in normal thread of execution, as a EventBase callback.
* *
* TAsyncSignalHandler may only be used in a single thread. It will only * AsyncSignalHandler may only be used in a single thread. It will only
* process signals received by the thread where the TAsyncSignalHandler is * process signals received by the thread where the AsyncSignalHandler is
* registered. It is the user's responsibility to ensure that signals are * registered. It is the user's responsibility to ensure that signals are
* delivered to the desired thread in multi-threaded programs. * delivered to the desired thread in multi-threaded programs.
*/ */
...@@ -53,7 +55,7 @@ class AsyncSignalHandler { ...@@ -53,7 +55,7 @@ class AsyncSignalHandler {
* signalReceived() will be called each time this thread receives this * signalReceived() will be called each time this thread receives this
* signal. * signal.
* *
* Throws a TException if an error occurs, or if this handler is already * Throws if an error occurs or if this handler is already
* registered for this signal. * registered for this signal.
*/ */
void registerSignalHandler(int signum); void registerSignalHandler(int signum);
...@@ -61,8 +63,7 @@ class AsyncSignalHandler { ...@@ -61,8 +63,7 @@ class AsyncSignalHandler {
/** /**
* Unregister for callbacks about the specified signal. * Unregister for callbacks about the specified signal.
* *
* Throws a TException if an error occurs, or if this signal was not * Throws if an error occurs, or if this signal was not registered.
* registered.
*/ */
void unregisterSignalHandler(int signum); void unregisterSignalHandler(int signum);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment